Crate secra_logger

Crate secra_logger 

Source
Expand description

secra-logger

基于 tracing 生态的日志系统,支持自适应模式

  • 库模式:检测到外部已初始化 subscriber,仅使用 tracing 宏记录,不初始化自己的 subscriber
  • 应用模式:检测到系统未初始化 subscriber,框架初始化 subscriber(console/file 等)

Modules§

event
Events represent single points in time during the execution of a program.
instrument
Attach a span to a std::future::Future.
span
Spans represent periods of time in which a program was executing in a particular context.

Macros§

debug
Constructs an event at the debug level.
error
Constructs an event at the error level.
event
Constructs a new Event.
info
Constructs an event at the info level.
span
Constructs a new span.
trace
Constructs an event at the trace level.
warn
Constructs an event at the warn level.

Structs§

LogConfig
日志配置
LogRotationConfig
日志轮转配置
Logger
日志器(支持自适应模式)
SubscriberDetector
Subscriber 检测器(带缓存)

Enums§

Error
LogFormat
日志格式
LoggingMode
日志模式
RotationStrategy
轮转策略

Type Aliases§

Result

Attribute Macros§

instrument
Instruments a function to create and enter a tracing span every time the function is called.