Documentation ¶
Overview ¶
Package logger 日志包,用于日志输出和打印
Package logger 日志包,用于日志输出和打印
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetCallFrame ¶
SetCallFrame 设定调用栈。
Types ¶
type LogFileFormatter ¶
type LogFileFormatter struct { logrus.TextFormatter MinimumCallerDepth int }
LogFileFormatter defines the format for log file.
func NewLogFileFormatter ¶
func NewLogFileFormatter() *LogFileFormatter
NewLogFileFormatter return the log format for log file.
eg: 2023-06-01T12:00:00 [info] [controllers/some_controller/code_file.go:99] foo key=value
type Logger ¶
type Logger struct { LogrusLogger *logrus.Logger ZapLogger *zap.Logger // contains filtered or unexported fields }
func NewLogger ¶
func NewLogger(level zapcore.Level, namespace string, logFilePath string, hook []logrus.Hook) (*Logger, error)
NewLogger 按需创建 logger 实例。
Click to show internal directories.
Click to hide internal directories.