v1.7.15 Latest Latest

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 2 Imported by: 5,390




View Source
const (
	// TextFormat represents the text logging format.
	// Deprecated: use [log.TextFormat].
	TextFormat log.OutputFormat = "text"

	// JSONFormat represents the JSON logging format.
	// Deprecated: use [log.JSONFormat].
	JSONFormat log.OutputFormat = "json"

Supported log output formats.

View Source
const RFC3339NanoFixed = log.RFC3339NanoFixed

RFC3339NanoFixed is time.RFC3339Nano with nanoseconds padded using zeros to ensure the formatted time is always the same number of characters.

Deprecated: use log.RFC3339NanoFixed.


View Source
var G = log.G

G is a shorthand for GetLogger.

Deprecated: use log.G.

View Source
var L = log.L

L is an alias for the standard logger.

Deprecated: use log.L.


func GetLevel deprecated added in v1.6.22

func GetLevel() log.Level

GetLevel returns the current log level.

Deprecated: use log.GetLevel.

func GetLogger deprecated

func GetLogger(ctx context.Context) *log.Entry

GetLogger retrieves the current logger from the context. If no logger is available, the default logger is returned.

Deprecated: use log.GetLogger.

func SetFormat deprecated added in v1.6.22

func SetFormat(format OutputFormat) error

SetFormat sets the log output format.

Deprecated: use log.SetFormat.

func SetLevel deprecated added in v1.6.22

func SetLevel(level string) error

SetLevel sets log level globally. It returns an error if the given level is not supported.

Deprecated: use log.SetLevel.

func WithLogger deprecated

func WithLogger(ctx context.Context, logger *log.Entry) context.Context

WithLogger returns a new context with the provided logger. Use in combination with logger.WithField(s) for great effect.

Deprecated: use log.WithLogger.


type Entry deprecated added in v1.6.24

type Entry = log.Entry

Entry is a logging entry.

Deprecated: use log.Entry.

type Fields deprecated added in v1.6.22

type Fields = log.Fields

Fields type to pass to "WithFields".

Deprecated: use log.Fields.

type Level deprecated added in v1.6.22

type Level = log.Level

Level is a logging level.

Deprecated: use log.Level.

const (
	// TraceLevel level.
	// Deprecated: use [log.TraceLevel].
	TraceLevel Level = log.TraceLevel

	// DebugLevel level.
	// Deprecated: use [log.DebugLevel].
	DebugLevel Level = log.DebugLevel

	// InfoLevel level.
	// Deprecated: use [log.InfoLevel].
	InfoLevel Level = log.InfoLevel

	// WarnLevel level.
	// Deprecated: use [log.WarnLevel].
	WarnLevel Level = log.WarnLevel

	// ErrorLevel level
	// Deprecated: use [log.ErrorLevel].
	ErrorLevel Level = log.ErrorLevel

	// FatalLevel level.
	// Deprecated: use [log.FatalLevel].
	FatalLevel Level = log.FatalLevel

	// PanicLevel level.
	// Deprecated: use [log.PanicLevel].
	PanicLevel Level = log.PanicLevel

Supported log levels.

type OutputFormat deprecated added in v1.6.24

type OutputFormat = log.OutputFormat

OutputFormat specifies a log output format.

Deprecated: use log.OutputFormat.


Path Synopsis

Jump to

Keyboard shortcuts

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