log

package
v0.14.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Caller added in v0.3.8

func Caller(depth int) string

Caller fetches the calling function name, skipping 'depth'.

func Debug added in v0.3.8

func Debug(ctx context.Context, a ...interface{})

func Debugf added in v0.3.8

func Debugf(ctx context.Context, s string, a ...interface{})

func EnableSyslog added in v0.3.8

func EnableSyslog(proto, addr string) error

EnableSyslog will enabling logging to the syslog at given address.

func Error added in v0.3.8

func Error(ctx context.Context, a ...interface{})

func Errorf added in v0.3.8

func Errorf(ctx context.Context, s string, a ...interface{})

func Fatal added in v0.3.8

func Fatal(ctx context.Context, a ...interface{})

func Fatalf added in v0.3.8

func Fatalf(ctx context.Context, s string, a ...interface{})

func Hook added in v0.7.1

func Hook(hook func(ctx context.Context, kvs []kv.Field) []kv.Field)

Hook adds the given hook to the global logger context hooks stack.

func Info added in v0.3.8

func Info(ctx context.Context, a ...interface{})

func Infof added in v0.3.8

func Infof(ctx context.Context, s string, a ...interface{})

func Level added in v0.3.8

func Level() level.LEVEL

Level returns the currently set log level.

func Log added in v0.3.8

func Log(ctx context.Context, lvl level.LEVEL, a ...interface{})

Log will log formatted args as 'msg' field to the log at given level.

func Logf added in v0.3.8

func Logf(ctx context.Context, lvl level.LEVEL, s string, a ...interface{})

Logf will log format string as 'msg' field to the log at given level.

func Panic added in v0.3.8

func Panic(ctx context.Context, a ...interface{})

func Panicf added in v0.3.8

func Panicf(ctx context.Context, s string, a ...interface{})

func ParseLevel added in v0.3.8

func ParseLevel(str string) error

ParseLevel will parse the log level from given string and set to appropriate level.

func Print added in v0.3.8

func Print(a ...interface{})

Print will log formatted args to the stdout log output.

func Printf added in v0.3.8

func Printf(s string, a ...interface{})

Print will log format string to the stdout log output.

func SetLevel added in v0.3.8

func SetLevel(lvl level.LEVEL)

SetLevel sets the max logging level.

func SetTimeFormat added in v0.12.0

func SetTimeFormat(format string)

SetTimeFormat sets the timestamp format to the given string.

func TimeFormat added in v0.12.0

func TimeFormat() string

TimeFormat returns the currently-set timestamp format.

func Trace added in v0.3.8

func Trace(ctx context.Context, a ...interface{})

func Tracef added in v0.3.8

func Tracef(ctx context.Context, s string, a ...interface{})

func VarDump added in v0.13.0

func VarDump(a any) string

VarDump returns a serialized, useful log / error output of given variable.

func Warn added in v0.3.8

func Warn(ctx context.Context, a ...interface{})

func Warnf added in v0.3.8

func Warnf(ctx context.Context, s string, a ...interface{})

Types

type Entry added in v0.3.8

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

func New added in v0.6.0

func New() Entry

New starts a new log entry.

func WithContext added in v0.7.1

func WithContext(ctx context.Context) Entry

func WithField added in v0.3.8

func WithField(key string, value interface{}) Entry

func WithFields added in v0.3.8

func WithFields(fields ...kv.Field) Entry

func (Entry) Debug added in v0.3.8

func (e Entry) Debug(a ...interface{})

func (Entry) Debugf added in v0.3.8

func (e Entry) Debugf(s string, a ...interface{})

func (Entry) Error added in v0.3.8

func (e Entry) Error(a ...interface{})

func (Entry) Errorf added in v0.3.8

func (e Entry) Errorf(s string, a ...interface{})

func (Entry) Fatal added in v0.3.8

func (e Entry) Fatal(a ...interface{})

func (Entry) Fatalf added in v0.3.8

func (e Entry) Fatalf(s string, a ...interface{})

func (Entry) Info added in v0.3.8

func (e Entry) Info(a ...interface{})

func (Entry) Infof added in v0.3.8

func (e Entry) Infof(s string, a ...interface{})

func (Entry) Log added in v0.3.8

func (e Entry) Log(lvl level.LEVEL, a ...interface{})

func (Entry) Logf added in v0.3.8

func (e Entry) Logf(lvl level.LEVEL, s string, a ...interface{})

func (Entry) Panic added in v0.3.8

func (e Entry) Panic(a ...interface{})

func (Entry) Panicf added in v0.3.8

func (e Entry) Panicf(s string, a ...interface{})

func (Entry) Print added in v0.3.8

func (e Entry) Print(a ...interface{})

func (Entry) Printf added in v0.3.8

func (e Entry) Printf(s string, a ...interface{})

func (Entry) Trace added in v0.3.8

func (e Entry) Trace(a ...interface{})

func (Entry) Tracef added in v0.3.8

func (e Entry) Tracef(s string, a ...interface{})

func (Entry) Warn added in v0.3.8

func (e Entry) Warn(a ...interface{})

func (Entry) Warnf added in v0.3.8

func (e Entry) Warnf(s string, a ...interface{})

func (Entry) WithContext added in v0.7.1

func (e Entry) WithContext(ctx context.Context) Entry

func (Entry) WithField added in v0.3.8

func (e Entry) WithField(key string, value interface{}) Entry

func (Entry) WithFields added in v0.3.8

func (e Entry) WithFields(kvs ...kv.Field) Entry

Jump to

Keyboard shortcuts

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