log

package
v0.0.0-...-9dff534 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: ISC Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug logs a debug-level message with optional key/value pairs.

func Debugf

func Debugf(template string, args ...interface{})

Debugf logs a debug-level message with formatting.

func Debugw

func Debugw(msg string, keysAndValues ...interface{})

Debugw logs a debug-level message with optional structured context.

func Error

func Error(args ...interface{})

Error logs an error-level message with optional key/value pairs.

func Errorf

func Errorf(template string, args ...interface{})

Errorf logs an error-level message with formatting.

func Errorw

func Errorw(msg string, keysAndValues ...interface{})

Errorw logs an error-level message with optional structured context.

func Fatal

func Fatal(args ...interface{})

Fatal logs a fatal-level message, then calls os.Exit(1).

func Fatalf

func Fatalf(template string, args ...interface{})

Fatalf logs a fatal-level message with formatting, then calls os.Exit(1).

func Fatalw

func Fatalw(msg string, keysAndValues ...interface{})

Fatalw logs a fatal-level message with optional structured context, then calls os.Exit(1).

func Info

func Info(args ...interface{})

Info logs an info-level message with optional key/value pairs.

func Infof

func Infof(template string, args ...interface{})

Infof logs an info-level message with formatting.

func Infow

func Infow(msg string, keysAndValues ...interface{})

Infow logs an info-level message with optional structured context.

func Panic

func Panic(args ...interface{})

Panic logs a panic-level message, then calls panic.

func Panicf

func Panicf(template string, args ...interface{})

Panicf logs a panic-level message with formatting, then calls panic.

func Panicw

func Panicw(msg string, keysAndValues ...interface{})

Panicw logs a panic-level message with optional structured context, then calls panic.

func SetLevel

func SetLevel(level Level)

SetLevel allows changing the log level dynamically.

func SetLogger

func SetLogger(l *zap.SugaredLogger)

SetLogger allows replacing the default logger with a custom one.

func Sync

func Sync() error

Sync flushes any buffered log entries.

func Warn

func Warn(args ...interface{})

Warn logs a warn-level message with optional key/value pairs.

func Warnf

func Warnf(template string, args ...interface{})

Warnf logs a warn-level message with formatting.

func Warnw

func Warnw(msg string, keysAndValues ...interface{})

Warnw logs a warn-level message with optional structured context.

Types

type Level

type Level zapcore.Level
const (
	DebugLevel  Level = Level(zapcore.DebugLevel)
	InfoLevel   Level = Level(zapcore.InfoLevel)
	WarnLevel   Level = Level(zapcore.WarnLevel)
	ErrorLevel  Level = Level(zapcore.ErrorLevel)
	DPanicLevel Level = Level(zapcore.DPanicLevel)
	PanicLevel  Level = Level(zapcore.PanicLevel)
	FatalLevel  Level = Level(zapcore.FatalLevel)
)

Jump to

Keyboard shortcuts

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