pub fn init<W2>(
    log_path_file: Option<(&Path, &str)>,
    terminal: &'static W2
) -> Vec<impl Drop>
where W2: MakeWriter<'static> + 'static, <W2 as MakeWriter<'static>>::Writer: 'static + Send + Sync,
Expand description

Initialise tracing and logging for the logs_path.

This function will attempt to set up both a file and a terminal logger, falling back to just a terminal logger if the file is unable to be created.

The logging level is by default set to INFO, to change this for any particular crate or module you must use the RUST_LOG environment variable.

For example to set this crate’s debug level to TRACE you would need the following in your environment. RUST_LOG="veloren_voxygen=trace"

more complex tracing can be done by concatenating with a , as separator:

  • warn for prometheus_hyper, dot_vox, gfx_device_gl::factory, gfx_device_gl::shadetrace forveloren_voxygen, info for everything else RUST_LOG=“prometheus_hyper=warn,dot_vox::parser=warn,gfx_device_gl:: factory=warn,gfx_device_gl::shade=warn,veloren_voxygen=trace,info”`

By default a few directives are set to warn by default, until explicitly overwritten! e.g. RUST_LOG="gfx_device_gl=debug"