Documentation
¶
Index ¶
- func EnableConsole(level Level, disableColor ...bool)
- func EnableConsoleWithFormatter(level Level, formatter logrus.Formatter)
- func EnableFileWithFormatter(level Level, formatter logrus.Formatter, fileConfig ...*lumberjack.Logger)
- func EnableFileWithJson(level Level, fileConfig ...*lumberjack.Logger)
- func EnableFileWithText(level Level, fileConfig ...*lumberjack.Logger)
- func IsLevelEnabled(level Level, log ...*logrus.Logger) bool
- func Logrus() *logrus.Logger
- func RawConsoleLogger() *logrus.Logger
- func RawFileLogger() *logrus.Logger
- func SetTraceIdSupplier(supplier TraceIdSupplier)
- type Level
- type TraceIdSupplier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableConsole ¶ added in v0.0.25
EnableConsole 启用该设置后,日志内容将向标准控台输出
func EnableConsoleWithFormatter ¶ added in v0.0.56
EnableConsoleWithFormatter 启用该设置后,日志内容将向标准控台输出
func EnableFileWithFormatter ¶ added in v0.0.56
func EnableFileWithFormatter(level Level, formatter logrus.Formatter, fileConfig ...*lumberjack.Logger)
EnableFileWithFormatter 启用该配置后写入日志文件,将日志输出为指定格式 如果要使用console+file需要先初始化Console配置
func EnableFileWithJson ¶ added in v0.0.25
func EnableFileWithJson(level Level, fileConfig ...*lumberjack.Logger)
EnableFileWithJson 启用该配置后将写入日志文件,并将日志输出json格式 如果要使用console+file需要先初始化Console配置
func EnableFileWithText ¶ added in v0.0.25
func EnableFileWithText(level Level, fileConfig ...*lumberjack.Logger)
EnableFileWithText 启用该配置后写入日志文件,将日志输出为text格式 如果要使用console+file需要先初始化Console配置
func IsLevelEnabled ¶ added in v0.0.57
IsLevelEnabled 判断指定级别是否启用 优先以fileLogger实例的状态判断
func RawConsoleLogger ¶ added in v0.0.57
RawConsoleLogger 获取原始控制台日志实例
func SetTraceIdSupplier ¶ added in v0.0.53
func SetTraceIdSupplier(supplier TraceIdSupplier)
SetTraceIdSupplier 设置TraceIdSupplier
Types ¶
type TraceIdSupplier ¶ added in v0.0.53
TraceIdSupplier 生成日志跟踪id
Click to show internal directories.
Click to hide internal directories.