Skip to main content

krun_init_log

Function krun_init_log 

Source
pub unsafe extern "C" fn krun_init_log(
    target_fd: c_int,
    level: u32,
    style: u32,
    options: u32,
) -> i32
Expand description

Initializes logging for the library.

Arguments: “target_fd” - File descriptor to write log to. Note that using a file descriptor pointing to a regular file on filesystem might slow down the VM. Use KRUN_LOG_TARGET_DEFAULT to use the default target for log output (stderr).

“level” - Level is an integer specifying the level of verbosity, higher number means more verbose log. The log levels are described by the constants: KRUN_LOG_LEVEL_{OFF, ERROR, WARN, INFO, DEBUG, TRACE}

“style” - Enable/disable usage of terminal escape sequences (to display colors) One of: KRUN_LOG_STYLE_{AUTO, ALWAYS, NEVER}.

“options” - Bitmask of logging options, use 0 for default options. KRUN_LOG_OPTION_NO_ENV to disallow environment variables to override these settings.

Returns: Zero on success or a negative error number on failure.