Expand description
Secra Logger - 生产级 Rust 日志系统库
基于 tracing 生态系统构建,支持结构化 JSON 日志、文件滚动、UTC+8 时区等特性。
§示例
use secra_logger::{LoggingConfig, LoggingModule, Logger};
// 创建日志配置
let config = LoggingConfig::default();
// 创建日志模块
let module = LoggingModule::new();
// 创建 Logger
let logger = Logger::new();Re-exports§
pub use tracing;
Modules§
- event
- Events represent single points in time during the execution of a program.
- 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§
- Event
Events represent single points in time where something occurred during the execution of a program.- Field
Normalization Layer - 字段规范化 Layer
- Level
- Describes the level of verbosity of a span or event.
- LogConsole
Config - 控制台输出配置
- LogFields
Config - 日志字段规范化配置
- LogFile
Config - 文件输出配置
- Logger
- Logger 组件
- Logging
Config - 日志配置
- Logging
Module - 日志模块
- Logrotate
Config - Logrotate 配置
- Span
- A handle representing a span, with the capability to enter the span if it exists.
- Vector
Batch Config - Vector 批量配置
- Vector
Config - Vector 日志收集器配置
- Vector
Request Config - Vector 请求配置
- Vector
Sink Config - Vector 输出目标配置
- Vector
Source Config - Vector 源配置
- Vector
Transform Config - Vector 转换配置
Enums§
- Output
Mode - 日志输出模式
Traits§
- Subscriber
- Trait representing the functions required to collect trace data.
Functions§
- normalize_
field_ name - 规范化字段名(驼峰转点分隔)
Type Aliases§
- Logger
Component - Logger 类型别名(用于 ComponentRegistry)