log

package
v1.103.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddField added in v1.104.0

func AddField(ctx context.Context, key string, value any)

AddField adds a field to the context logger.

func SetJww added in v1.7.1

func SetJww(verbose bool, w io.Writer)

SetJww sets jww log when debug enabled.

func ToContext added in v1.104.0

func ToContext(ctx context.Context, logger *Logger) context.Context

ToContext adds the log.Logger to the context for extraction later. Returning the new context that has been created.

Types

type Logger added in v1.104.0

type Logger struct {
	// contains filtered or unexported fields
}

Logger is the log entry.

func Extract added in v1.104.0

func Extract(ctx context.Context) *Logger

Extract takes the call-scoped Logger.

func New added in v1.104.0

func New(verbose, sendDiagsOnErrors, metrics bool) *Logger

New creates a new Logger.

func (*Logger) Debugf added in v1.104.0

func (l *Logger) Debugf(format string, args ...any)

Debugf logs a message at level Debug.

func (*Logger) Debugln added in v1.104.0

func (l *Logger) Debugln(args ...any)

Debugln logs a message at level Debug.

func (*Logger) Errorf added in v1.104.0

func (l *Logger) Errorf(format string, args ...any)

Errorf logs a message at level Error.

func (*Logger) Errorln added in v1.104.0

func (l *Logger) Errorln(args ...any)

Errorln logs a message at level Error.

func (*Logger) Fatalf added in v1.104.0

func (l *Logger) Fatalf(format string, args ...any)

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

func (l *Logger) Fatalln(args ...any)

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) Infof added in v1.104.0

func (l *Logger) Infof(format string, args ...any)

Infof logs a message at level Info.

func (*Logger) Infoln added in v1.104.0

func (l *Logger) Infoln(args ...any)

Infoln logs a message at level Info.

func (*Logger) IsMetricsEnabled added in v1.104.0

func (l *Logger) IsMetricsEnabled() bool

IsMetricsEnabled returns true if it should collect metrics.

func (*Logger) IsVerboseEnabled added in v1.104.0

func (l *Logger) IsVerboseEnabled() bool

IsVerboseEnabled returns true if debug is enabled.

func (*Logger) Output added in v1.104.0

func (l *Logger) Output() io.Writer

Output returns the current log output.

func (*Logger) SendDiagsOnErrors added in v1.104.0

func (l *Logger) SendDiagsOnErrors() bool

SendDiagsOnErrors returns true if diagnostics should be sent on errors.

func (*Logger) SetOutput added in v1.104.0

func (l *Logger) SetOutput(w io.Writer)

SetOutput defines sets the log output to io.Writer.

func (*Logger) SetVerbose added in v1.104.0

func (l *Logger) SetVerbose(verbose bool)

SetVerbose sets log level to debug if enabled.

func (*Logger) Warnf added in v1.104.0

func (l *Logger) Warnf(format string, args ...any)

Warnf logs a message at level Warn.

func (*Logger) Warnln added in v1.104.0

func (l *Logger) Warnln(args ...any)

Warnln logs a message at level Warn.

func (*Logger) WithField added in v1.104.0

func (l *Logger) WithField(key string, value any)

WithField adds a single field to the Logger.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL