Module config

Source
Expand description

Module containing the Config struct and its associated enums.

Structs§

Config
‘Config’ struct that contains the configuration options for the logger. Use Default::default() for the default settings.

Enums§

ConsoleMode
The output stream for the console. Only applies if LoggingMode is Console or FileAndConsole. Defaults to Stdout.
DateTimeFormat
The format of the date and time in the log entries. Defaults to ISO8601.
LoggingMode
Where the logs are written to. Defaults to Console
LoggingStrategy
Whether to write log entries synchronously (io-blocking) or asynchronously. When using asynchronous logging, make sure to call log::logger().flush() before exiting the program. Defaults to Synchronous.
OutputDirName
The name of the directory where the log file is written to. Only applies if LoggingMode is File or FileAndConsole. Defaults to Custom with the output directory being logs.
OutputFileName
The name of the log file. Only applies if LoggingMode is File or FileAndConsole. Defaults to AutoGenerate.
SplitLogFiles
Whether to split the log files by size or not. This has no effect if OutputFileName is Custom, since the new file will have the same name as the old one. If True, the log files will be split when they reach the specified size (in bytes). Defaults to False.
TimeZone
The time zone used for the log entries. Make sure to use UTC for async programs. Defaults to UTC.
UseTermColor
Whether to use ANSI escape codes to color the log entries in the terminal. Defaults to True.