mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
go1.16 (#14783)
This commit is contained in:
19
vendor/go.uber.org/zap/options.go
generated
vendored
19
vendor/go.uber.org/zap/options.go
generated
vendored
@@ -86,15 +86,15 @@ func Development() Option {
|
||||
})
|
||||
}
|
||||
|
||||
// AddCaller configures the Logger to annotate each message with the filename
|
||||
// and line number of zap's caller. See also WithCaller.
|
||||
// AddCaller configures the Logger to annotate each message with the filename,
|
||||
// line number, and function name of zap's caller. See also WithCaller.
|
||||
func AddCaller() Option {
|
||||
return WithCaller(true)
|
||||
}
|
||||
|
||||
// WithCaller configures the Logger to annotate each message with the filename
|
||||
// and line number of zap's caller, or not, depending on the value of enabled.
|
||||
// This is a generalized form of AddCaller.
|
||||
// WithCaller configures the Logger to annotate each message with the filename,
|
||||
// line number, and function name of zap's caller, or not, depending on the
|
||||
// value of enabled. This is a generalized form of AddCaller.
|
||||
func WithCaller(enabled bool) Option {
|
||||
return optionFunc(func(log *Logger) {
|
||||
log.addCaller = enabled
|
||||
@@ -125,9 +125,16 @@ func IncreaseLevel(lvl zapcore.LevelEnabler) Option {
|
||||
return optionFunc(func(log *Logger) {
|
||||
core, err := zapcore.NewIncreaseLevelCore(log.core, lvl)
|
||||
if err != nil {
|
||||
fmt.Fprintf(log.errorOutput, "failed to IncreaseLevel: %v", err)
|
||||
fmt.Fprintf(log.errorOutput, "failed to IncreaseLevel: %v\n", err)
|
||||
} else {
|
||||
log.core = core
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// OnFatal sets the action to take on fatal logs.
|
||||
func OnFatal(action zapcore.CheckWriteAction) Option {
|
||||
return optionFunc(func(log *Logger) {
|
||||
log.onFatal = action
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user