log

package
v0.0.0-...-a47d1aa Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Must

func Must[T any](val T, err error) T

Types

type Logger

type Logger interface {
	// Debug logs a message on a Debug level with optional key-value pairs.
	Debug(msg string, keysAndValues ...any)

	// Debugf uses fmt.Sprintf to log a templated message.
	Debugf(template string, args ...any)

	// Info logs a message on an Info level with optional key-value pairs.
	Info(msg string, keysAndValues ...any)

	// Infof uses fmt.Sprintf to log a templated message.
	Infof(template string, args ...any)

	// Warn logs a message on a Warn level with optional key-value pairs.
	Warn(msg string, keysAndValues ...any)

	// Warnf uses fmt.Sprintf to log a templated message.
	Warnf(template string, args ...any)

	// Error logs a message on an Error level with optional key-value pairs.
	Error(msg string, keysAndValues ...any)

	// Errorf uses fmt.Sprintf to log a templated message.
	Errorf(template string, args ...any)

	// Panic logs a message on a Panic level with optional key-value pairs and
	// then panics.
	Panic(msg string, keysAndValues ...any)

	// Panicf uses fmt.Sprintf to log a templated message, then panics.
	Panicf(template string, args ...any)

	// Fatal logs a message on a Fatal level with optional key-value pairs and
	// then calls os.Exit(1).
	Fatal(msg string, keysAndValues ...any)

	// Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
	Fatalf(template string, args ...any)

	// With adds a variadic number of fields to the logging context.
	With(keysAndValues ...any) Logger

	// Simple creates a new SimpleLogger.
	Simple() SimpleLogger
}

type NoopLogger

type NoopLogger struct{}

func NewNoopLogger

func NewNoopLogger() NoopLogger

func (NoopLogger) Debug

func (n NoopLogger) Debug(_ string, _ ...any)

func (NoopLogger) Debugf

func (n NoopLogger) Debugf(_ string, _ ...any)

func (NoopLogger) Error

func (n NoopLogger) Error(_ string, _ ...any)

func (NoopLogger) Errorf

func (n NoopLogger) Errorf(_ string, _ ...any)

func (NoopLogger) Fatal

func (n NoopLogger) Fatal(_ string, _ ...any)

func (NoopLogger) Fatalf

func (n NoopLogger) Fatalf(_ string, _ ...any)

func (NoopLogger) Info

func (n NoopLogger) Info(_ string, _ ...any)

func (NoopLogger) Infof

func (n NoopLogger) Infof(_ string, _ ...any)

func (NoopLogger) Panic

func (n NoopLogger) Panic(_ string, _ ...any)

func (NoopLogger) Panicf

func (n NoopLogger) Panicf(_ string, _ ...any)

func (NoopLogger) Simple

func (n NoopLogger) Simple() SimpleLogger

func (NoopLogger) Warn

func (n NoopLogger) Warn(_ string, _ ...any)

func (NoopLogger) Warnf

func (n NoopLogger) Warnf(_ string, _ ...any)

func (NoopLogger) With

func (n NoopLogger) With(_ ...any) Logger

type NoopSimpleLogger

type NoopSimpleLogger struct{}

func NewNoopSimpleLogger

func NewNoopSimpleLogger() NoopSimpleLogger

func (NoopSimpleLogger) Log

func (n NoopSimpleLogger) Log(_ ...interface{}) error

type SimpleLogger

type SimpleLogger interface {
	Log(keysAndValues ...interface{}) error
}

type ZapLogger

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

func NewZapLogger

func NewZapLogger(name, lvl string, outputPaths []string) (*ZapLogger, error)

func (*ZapLogger) Close

func (z *ZapLogger) Close() error

func (*ZapLogger) Debug

func (z *ZapLogger) Debug(msg string, keysAndValues ...any)

func (*ZapLogger) Debugf

func (z *ZapLogger) Debugf(template string, args ...any)

func (*ZapLogger) Error

func (z *ZapLogger) Error(msg string, keysAndValues ...any)

func (*ZapLogger) Errorf

func (z *ZapLogger) Errorf(template string, args ...any)

func (*ZapLogger) Fatal

func (z *ZapLogger) Fatal(msg string, keysAndValues ...any)

func (*ZapLogger) Fatalf

func (z *ZapLogger) Fatalf(template string, args ...any)

func (*ZapLogger) Info

func (z *ZapLogger) Info(msg string, keysAndValues ...any)

func (*ZapLogger) Infof

func (z *ZapLogger) Infof(template string, args ...any)

func (*ZapLogger) Panic

func (z *ZapLogger) Panic(msg string, keysAndValues ...any)

func (*ZapLogger) Panicf

func (z *ZapLogger) Panicf(template string, args ...any)

func (*ZapLogger) Simple

func (z *ZapLogger) Simple() SimpleLogger

func (*ZapLogger) Warn

func (z *ZapLogger) Warn(msg string, keysAndValues ...any)

func (*ZapLogger) Warnf

func (z *ZapLogger) Warnf(template string, args ...any)

func (*ZapLogger) With

func (z *ZapLogger) With(keysAndValues ...any) Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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