Skip to content

config πŸ”—

Interface to the struct vaccel_config C object.

Config πŸ”—

Config(
    plugins: str = "libvaccel-noop.so",
    log_level: int = 1,
    log_file: str | None = None,
    *,
    profiling_enabled: bool = False,
    version_ignore: bool = False,
)

Bases: CType

Wrapper for the struct vaccel_config C object.

Manages the creation and initialization of a C struct vaccel_config and provides access to it through Python properties.

Inherits

CType: Abstract base class for defining C data types.

Parameters:

Name Type Description Default

plugins πŸ”—

str

Colon-separated list of plugin names to load.

'libvaccel-noop.so'

log_level πŸ”—

int

Logging level (1=ERROR, 4=DEBUG).

1

log_file πŸ”—

str | None

Path to log file or None to disable logging to file.

None

profiling_enabled πŸ”—

bool

Enable or disable profiling.

False

version_ignore πŸ”—

bool

Ignore version mismatches if True.

False
Source code in vaccel/config.py
def __init__(
    self,
    plugins: str = "libvaccel-noop.so",
    log_level: int = 1,
    log_file: str | None = None,
    *,
    profiling_enabled: bool = False,
    version_ignore: bool = False,
):
    """Initializes a new `Config` object.

    Args:
        plugins (str): Colon-separated list of plugin names to load.
        log_level (int): Logging level (1=ERROR, 4=DEBUG).
        log_file (str | None): Path to log file or None to disable logging
            to file.
        profiling_enabled (bool): Enable or disable profiling.
        version_ignore (bool): Ignore version mismatches if True.
    """
    self._plugins = str(plugins)
    self._log_level = log_level
    self._log_file = log_file
    self._profiling_enabled = profiling_enabled
    self._version_ignore = version_ignore
    self._c_obj_ptr = ffi.NULL
    super().__init__()

c_size property πŸ”—

c_size: int

Returns the size of the object in bytes.

log_file property πŸ”—

log_file: str | None

The configured log file.

Returns:

Type Description
str | None

The config's log file.

log_level property πŸ”—

log_level: int

The configured log level.

Returns:

Type Description
int

The config's log level.

plugins property πŸ”—

plugins: str

The configured plugins.

Returns:

Type Description
str

The config's plugins.

profiling_enabled property πŸ”—

profiling_enabled: bool

If profiling is enabled or disabled.

Returns:

Type Description
bool

True if profiling is enabled.

value property πŸ”—

value: CData

Returns the value of the underlying C struct.

Returns:

Type Description
CData

The dereferenced 'struct vaccel_config`

version_ignore property πŸ”—

version_ignore: bool

Whether a plugin/vAccel version mismatch is ignored.

Returns:

Type Description
bool

True if version mismatch is ignored.