logging_init

Function logging_init 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn logging_init( trader_id: TraderId, instance_id: UUID4, level_stdout: LogLevel, level_file: LogLevel, directory_ptr: *const c_char, file_name_ptr: *const c_char, file_format_ptr: *const c_char, component_levels_ptr: *const c_char, is_colored: u8, is_bypassed: u8, print_config: u8, max_file_size: u64, max_backup_count: u32, ) -> LogGuard_API
Expand description

Initializes logging.

Logging should be used for Python and sync Rust logic which is most of the components in the 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 application’s run, ideally at the beginning of the run.

This function assumes:

  • directory_ptr is either NULL or a valid C string pointer.
  • file_name_ptr is either NULL or a valid C string pointer.
  • file_format_ptr is either NULL or a valid C string pointer.
  • component_level_ptr is either NULL or a valid C string pointer.

§Panics

Panics if initializing the Rust logger fails.