Documentation
¶
Index ¶
- func ConfigureFromEnv()
- func Debugf(c context.Context, format string, args ...interface{})
- func Error(c context.Context, args ...interface{})
- func ErrorWithFields(c context.Context, err error, fields logrus.Fields)
- func Errorf(c context.Context, format string, args ...interface{})
- func Fatalf(c context.Context, format string, args ...interface{})
- func GetLogger(c context.Context) *logrus.Entry
- func Info(c context.Context, args ...interface{})
- func Infof(c context.Context, format string, args ...interface{})
- func Warn(c context.Context, args ...interface{})
- func Warnf(c context.Context, format string, args ...interface{})
- type CustomFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureFromEnv ¶
func ConfigureFromEnv()
ConfigureFromEnv 重新从环境变量应用日志配置。 这允许在 main() 中加载 .env 后,让 LOG_LEVEL / LOG_PATH 立即生效。
func ErrorWithFields ¶
ErrorWithFields 输出带有额外字段的错误级别日志
Types ¶
type CustomFormatter ¶
type CustomFormatter struct {
ForceColor bool // 是否强制使用颜色,即使在非终端环境下
}
Click to show internal directories.
Click to hide internal directories.