Documentation ¶
Index ¶
- func AddField(ctx context.Context, key string, value any)
- func SetJww(verbose bool, w io.Writer)
- func ToContext(ctx context.Context, logger *Logger) context.Context
- type DynamicWriteSyncer
- type Logger
- func (l *Logger) Debugf(format string, args ...any)
- func (l *Logger) Debugln(msg string)
- func (l *Logger) Errorf(format string, args ...any)
- func (l *Logger) Errorln(msg string)
- func (l *Logger) Fatalf(format string, args ...any)
- func (l *Logger) Fatalln(msg string)
- func (l *Logger) Flush()
- func (l *Logger) Infof(format string, args ...any)
- func (l *Logger) Infoln(msg string)
- func (l *Logger) IsMetricsEnabled() bool
- func (l *Logger) IsVerboseEnabled() bool
- func (l *Logger) Output() io.Writer
- func (l *Logger) SendDiagsOnErrors() bool
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) SetVerbose(verbose bool)
- func (l *Logger) Warnf(format string, args ...any)
- func (l *Logger) Warnln(msg string)
- func (l *Logger) WithField(key string, value any)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DynamicWriteSyncer ¶ added in v1.104.0
type DynamicWriteSyncer struct {
// contains filtered or unexported fields
}
DynamicWriteSyncer allows changing the underlying WriteSyncer at runtime.
func NewDynamicWriteSyncer ¶ added in v1.104.0
func NewDynamicWriteSyncer(initial zapcore.WriteSyncer) *DynamicWriteSyncer
NewDynamicWriteSyncer initializes the dynamic writer with an initial writer.
func (*DynamicWriteSyncer) SetWriter ¶ added in v1.104.0
func (d *DynamicWriteSyncer) SetWriter(newWriter zapcore.WriteSyncer)
SetWriter allows updating the underlying writer at runtime.
func (*DynamicWriteSyncer) Sync ¶ added in v1.104.0
func (d *DynamicWriteSyncer) Sync() error
Sync calls Sync on the current writer.
type Logger ¶ added in v1.104.0
type Logger struct {
// contains filtered or unexported fields
}
Logger is the log entry.
func (*Logger) Fatalf ¶ added in v1.104.0
Fatalf logs a message at level Fatal then the process will exit with status set to 1.
func (*Logger) Fatalln ¶ added in v1.104.0
Fatalln logs a message at level Fatal then the process will exit with status set to 1.
func (*Logger) Flush ¶ added in v1.104.0
func (l *Logger) Flush()
Flush flushes the log output and closes the file.
func (*Logger) IsMetricsEnabled ¶ added in v1.104.0
IsMetricsEnabled returns true if it should collect metrics.
func (*Logger) IsVerboseEnabled ¶ added in v1.104.0
IsVerboseEnabled returns true if debug is enabled.
func (*Logger) SendDiagsOnErrors ¶ added in v1.104.0
SendDiagsOnErrors returns true if diagnostics should be sent on errors.
func (*Logger) SetVerbose ¶ added in v1.104.0
SetVerbose sets log level to debug if enabled.
type Option ¶ added in v1.104.0
type Option func(*Logger)
Option is a functional option for Logger.
func WithMetrics ¶ added in v1.104.0
WithMetrics sets metrics mode.
func WithSendDiagsOnErrors ¶ added in v1.104.0
WithSendDiagsOnErrors sets send diagnostics on errors mode.
func WithVerbose ¶ added in v1.104.0
WithVerbose sets verbose mode.