logger

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: GPL-3.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCustomOptions = &CustomOptions{
		CtxFiles:            []string{},
		InternalFilesPrefix: "x_",
	}
)

Functions

func AddCtxFields

func AddCtxFields(fields []string)

func AddHook

func AddHook(hook log.Hook)

func Debug

func Debug(args ...interface{})

Debug logs a message at level Debug on the standard logger.

func DebugFn

func DebugFn(fn log.LogFunction)

DebugFn logs a message from a func at level Debug on the standard logger.

func DebugFnX

func DebugFnX(ctx context.Context, fn log.LogFunction)

DebugFnX logs a message from a func at level Debug on the standard logger.

func DebugX

func DebugX(ctx context.Context, args ...interface{})

DebugX logs a message at level Debug on the standard logger.

func Debugf

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

Debugf logs a message at level Debug on the standard logger.

func DebugfX

func DebugfX(ctx context.Context, format string, args ...interface{})

DebugfX logs a message at level Debug on the standard logger.

func Debugln

func Debugln(args ...interface{})

Debugln logs a message at level Debug on the standard logger.

func DebuglnX

func DebuglnX(ctx context.Context, args ...interface{})

DebuglnX logs a message at level Debug on the standard logger.

func Error

func Error(args ...interface{})

Error logs a message at level Error on the standard logger.

func ErrorFn

func ErrorFn(fn log.LogFunction)

ErrorFn logs a message from a func at level Error on the standard logger.

func ErrorFnX

func ErrorFnX(ctx context.Context, fn log.LogFunction)

ErrorFnX logs a message from a func at level Error on the standard logger.

func ErrorX

func ErrorX(ctx context.Context, args ...interface{})

ErrorX logs a message at level Error on the standard logger.

func Errorf

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

Errorf logs a message at level Error on the standard logger.

func ErrorfX

func ErrorfX(ctx context.Context, format string, args ...interface{})

ErrorfX logs a message at level Error on the standard logger.

func Errorln

func Errorln(args ...interface{})

Errorln logs a message at level Error on the standard logger.

func ErrorlnX

func ErrorlnX(ctx context.Context, args ...interface{})

ErrorlnX logs a message at level Error on the standard logger.

func Fatal

func Fatal(args ...interface{})

Fatal logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func FatalFn

func FatalFn(fn log.LogFunction)

FatalFn logs a message from a func at level Fatal on the standard logger then the process will exit with status set to 1.

func FatalFnX

func FatalFnX(ctx context.Context, fn log.LogFunction)

FatalFnX logs a message from a func at level Fatal on the standard logger then the process will exit with status set to 1.

func FatalX

func FatalX(ctx context.Context, args ...interface{})

FatalX logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func Fatalf

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

Fatalf logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func FatalfX

func FatalfX(ctx context.Context, format string, args ...interface{})

FatalfX logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func Fatalln

func Fatalln(args ...interface{})

Fatalln logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func FatallnX

func FatallnX(ctx context.Context, args ...interface{})

FatallnX logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func Info

func Info(args ...interface{})

Info logs a message at level Info on the standard logger.

func InfoFn

func InfoFn(fn log.LogFunction)

InfoFn logs a message from a func at level Info on the standard logger.

func InfoFnX

func InfoFnX(ctx context.Context, fn log.LogFunction)

InfoFnX logs a message from a func at level Info on the standard logger.

func InfoX

func InfoX(ctx context.Context, args ...interface{})

InfoX logs a message at level Info on the standard logger.

func Infof

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

Infof logs a message at level Info on the standard logger.

func InfofX

func InfofX(ctx context.Context, format string, args ...interface{})

InfofX logs a message at level Info on the standard logger.

func Infoln

func Infoln(args ...interface{})

Infoln logs a message at level Info on the standard logger.

func InfolnX

func InfolnX(ctx context.Context, args ...interface{})

InfolnX logs a message at level Info on the standard logger.

func InitLogger

func InitLogger()

func Panic

func Panic(args ...interface{})

Panic logs a message at level Panic on the standard logger.

func PanicFn

func PanicFn(fn log.LogFunction)

PanicFn logs a message from a func at level Panic on the standard logger.

func PanicFnX

func PanicFnX(ctx context.Context, fn log.LogFunction)

PanicFnX logs a message from a func at level Panic on the standard logger.

func PanicX

func PanicX(ctx context.Context, args ...interface{})

PanicX logs a message at level Panic on the standard logger.

func Panicf

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

Panicf logs a message at level Panic on the standard logger.

func PanicfX

func PanicfX(ctx context.Context, format string, args ...interface{})

PanicfX logs a message at level Panic on the standard logger.

func Panicln

func Panicln(args ...interface{})

Panicln logs a message at level Panic on the standard logger.

func PaniclnX

func PaniclnX(ctx context.Context, args ...interface{})

PaniclnX logs a message at level Panic on the standard logger.

func Print

func Print(args ...interface{})

Print logs a message at level Info on the standard logger.

func PrintFn

func PrintFn(fn log.LogFunction)

PrintFn logs a message from a func at level Info on the standard logger.

func PrintFnX

func PrintFnX(ctx context.Context, fn log.LogFunction)

PrintFnX logs a message from a func at level Info on the standard logger.

func PrintX

func PrintX(ctx context.Context, args ...interface{})

PrintX logs a message at level Info on the standard logger.

func Printf

func Printf(format string, args ...interface{})

Printf logs a message at level Info on the standard logger.

func PrintfX

func PrintfX(ctx context.Context, format string, args ...interface{})

PrintfX logs a message at level Info on the standard logger.

func Println

func Println(args ...interface{})

Println logs a message at level Info on the standard logger.

func PrintlnX

func PrintlnX(ctx context.Context, args ...interface{})

PrintlnX logs a message at level Info on the standard logger.

func Trace

func Trace(args ...interface{})

Trace logs a message at level Trace on the standard logger.

func TraceFn

func TraceFn(fn log.LogFunction)

TraceFn logs a message from a func at level Trace on the standard logger.

func TraceFnX

func TraceFnX(ctx context.Context, fn log.LogFunction)

TraceFnX logs a message from a func at level Trace on the standard logger.

func TraceX

func TraceX(ctx context.Context, args ...interface{})

TraceX logs a message at level Trace on the standard logger.

func Tracef

func Tracef(format string, args ...interface{})

Tracef logs a message at level Trace on the standard logger.

func TracefX

func TracefX(ctx context.Context, format string, args ...interface{})

TracefX logs a message at level Trace on the standard logger.

func Traceln

func Traceln(args ...interface{})

Traceln logs a message at level Trace on the standard logger.

func TracelnX

func TracelnX(ctx context.Context, args ...interface{})

TracelnX logs a message at level Trace on the standard logger.

func Warn

func Warn(args ...interface{})

Warn logs a message at level Warn on the standard logger.

func WarnFn

func WarnFn(fn log.LogFunction)

WarnFn logs a message from a func at level Warn on the standard logger.

func WarnFnX

func WarnFnX(ctx context.Context, fn log.LogFunction)

WarnFnX logs a message from a func at level Warn on the standard logger.

func WarnX

func WarnX(ctx context.Context, args ...interface{})

WarnX logs a message at level Warn on the standard logger.

func Warnf

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

Warnf logs a message at level Warn on the standard logger.

func WarnfX

func WarnfX(ctx context.Context, format string, args ...interface{})

WarnfX logs a message at level Warn on the standard logger.

func Warning

func Warning(args ...interface{})

Warning logs a message at level Warn on the standard logger.

func WarningFn

func WarningFn(fn log.LogFunction)

WarningFn logs a message from a func at level Warn on the standard logger.

func WarningFnX

func WarningFnX(ctx context.Context, fn log.LogFunction)

WarningFnX logs a message from a func at level Warn on the standard logger.

func WarningX

func WarningX(ctx context.Context, args ...interface{})

WarningX logs a message at level Warn on the standard logger.

func Warningf

func Warningf(format string, args ...interface{})

Warningf logs a message at level Warn on the standard logger.

func WarningfX

func WarningfX(ctx context.Context, format string, args ...interface{})

WarningfX logs a message at level Warn on the standard logger.

func Warningln

func Warningln(args ...interface{})

Warningln logs a message at level Warn on the standard logger.

func WarninglnX

func WarninglnX(ctx context.Context, args ...interface{})

WarninglnX logs a message at level Warn on the standard logger.

func Warnln

func Warnln(args ...interface{})

Warnln logs a message at level Warn on the standard logger.

func WarnlnX

func WarnlnX(ctx context.Context, args ...interface{})

WarnlnX logs a message at level Warn on the standard logger.

func WithContext

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

WithContext creates an entry from the standard logger and adds a context to it.

func WithError

func WithError(err error) *log.Entry

WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key.

func WithField

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

WithField creates an entry from the standard logger and adds a field to it. If you want multiple fields, use `WithFields`.

Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.

func WithFields

func WithFields(fields log.Fields) *log.Entry

WithFields creates an entry from the standard logger and adds multiple fields to it. This is simply a helper for `WithField`, invoking it once for each field.

Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.

func WithTime

func WithTime(t time.Time) *log.Entry

WithTime creates an entry from the standard logger and overrides the time of logs generated with it.

Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.

Types

type BaseOptions

type BaseOptions struct {
	Path         string
	RotationTime time.Duration
	WithMaxAge   time.Duration
	Level        string
}

type CustomOptions

type CustomOptions struct {
	CtxFiles            []string
	InternalFilesPrefix string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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