Documentation
¶
Overview ¶
Package logger 提供了基于 zap 的日志功能和依赖注入支持
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Level string `json:"level"` // 日志级别: debug, info, warn, error
Development bool `json:"development"` // 是否为开发模式
Encoding string `json:"encoding"` // 编码格式: json, console
}
Config 定义日志配置
type Logger ¶
Logger 是 zap.Logger 的类型别名,方便使用
func NewDevelopmentLogger ¶
func NewDevelopmentLogger() *Logger
NewDevelopmentLogger 创建一个开发环境的 logger
Click to show internal directories.
Click to hide internal directories.