init_logging

Function init_logging 

Source
pub fn init_logging(config: &Config) -> Option<WorkerGuard>
Expand description

Initialize logging based on the provided configuration.

If log_to_file is enabled, logs will be written to daily files in log_dir. Otherwise, logs are written to stdout.

Returns an optional WorkerGuard. This guard MUST be held for the duration of the program (e.g., assigned to a variable in main). If dropped, log flushing may not complete.