Module logger Copy item path Source code_examples Examples for the flexi_logger
initialization. error_info Error codes of flexi_logger
. filter This module contains two traits which allow adding a stateful filter
using Logger::filter
. writers Describes how to extend flexi_logger
with additional log writers. debug Logs a message at the debug level. error Logs a message at the error level. info Logs a message at the info level. trace Logs a message at the trace level. DeferredNow Deferred timestamp creation. FileSpec Builder object for specifying the name and path of the log output file. LogSpecBuilder Builder for LogSpecification
. LogSpecification Immutable struct that defines which loglines are to be written,
based on the module, the log level, and the text. LogfileSelector Used in LoggerHandle::existing_log_files
. Logger The entry-point for using flexi_logger
. LoggerHandle Allows reconfiguring the logger while the program is running, and
shuts down the logger when it is dropped . ModuleFilter Defines which loglevel filter to use for the specified module. Record The “payload” of a log message. AdaptiveFormat Helps to use coloring only if the output goes to a tty. Age The age after which a log file rotation will be triggered,
when Criterion::Age
is chosen. Cleanup Defines the strategy for handling older log files. Criterion Criterion when to rotate the log file. Duplicate Used to control which messages are to be duplicated to stderr, when log_to_file()
is used. ErrorChannel Enum for defining the output channel for flexi_logger
’s own error messages. FlexiLoggerError Describes errors in the initialization of flexi_logger
. Level An enum representing the available verbosity levels of the logger. LevelFilter An enum representing the available verbosity level filters of the logger. Naming The naming convention for rotated log files. WriteMode Describes whether the log output should be written synchronously or asynchronously,
and if and how I/O should be buffered and flushed. DEFAULT_BUFFER_CAPACITY Default buffer capacity (8k), when buffering is used. DEFAULT_FLUSH_INTERVAL Default flush interval (1s), when flushing is used. DEFAULT_MESSAGE_CAPA Default capacity for the message buffers;
a higher value reduces allocations when longer log lines are used. DEFAULT_POOL_CAPA Default size of the message pool;
a higher value could further reduce allocations during log file rotation and cleanup. TS_DASHES_BLANK_COLONS_DOT_BLANK Time stamp format that is used by the provided format functions. colored_default_format A colored version of the logline-formatter default_format
. colored_detailed_format A colored version of the logline-formatter detailed_format
. colored_opt_format A colored version of the logline-formatter opt_format
. colored_with_thread A colored version of the logline-formatter with_thread
. default_format A logline-formatter that produces log lines like
INFO [my_prog::some_submodule] Task successfully read from conf.json
. detailed_format A logline-formatter that produces log lines like
[2016-01-13 15:25:01.640870 +01:00] INFO [foo::bar] src/foo/bar.rs:26: Task successfully read from conf.json
init Shortest form to get started. logger_feature let _ = custom_utils::logger::logger_feature(“lapce”, “warn,wgpu_core=error,lapce_app::keypress::loader=info”, log::LevelFilter::Info, true)
.build();
let _ = custom_utils::logger::logger_feature(“lapce”, log::LevelFilter::Debug, log::LevelFilter::Info, true)
.build(); logger_feature_with_path log_etc_reset 配置文件每次重启都重置 logger_stdout 简单,纯粹想输出日志而已。适用于临时
控制台输出日志
logger_stdout(“info,custom_utils=warn”) logger_stdout_debug opt_format A logline-formatter that produces log lines with timestamp and file location, like
[2016-01-13 15:25:01.640870 +01:00] INFO [src/foo/bar:26] Task successfully read from conf.json
style Helper function that is used in the provided coloring format functions to apply
colors based on the log level and the effective color palette. with_thread A logline-formatter that produces log lines like
[2016-01-13 15:25:01.640870 +01:00] T[taskreader] INFO [src/foo/bar:26] Task successfully read from conf.json
FormatFunction Function type for format functions.