nautilus_common::python::logging

Function py_init_logging

Source
pub fn py_init_logging(
    trader_id: TraderId,
    instance_id: UUID4,
    level_stdout: LogLevel,
    level_file: Option<LogLevel>,
    component_levels: Option<HashMap<String, String>>,
    directory: Option<String>,
    file_name: Option<String>,
    file_format: Option<String>,
    is_colored: Option<bool>,
    is_bypassed: Option<bool>,
    print_config: Option<bool>,
) -> LogGuard
Expand description

Initialize logging.

Logging should be used for Python and sync Rust logic which is most of the components in the main nautilus_trader package. Logging can be configured to filter components and write up to a specific level only by passing a configuration using the NAUTILUS_LOG environment variable.

ยงSafety

Should only be called once during an applications run, ideally at the beginning of the run.