logger

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fields

type Fields map[string]any

type Level

type Level int8
const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarn
	LevelError
	LevelFatal
	LevelPanic
)

func (Level) String

func (l Level) String() string

type Logger

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

func NewLogger

func NewLogger(w io.Writer, prefix string, flag int) *Logger

func (*Logger) Debug

func (l *Logger) Debug(ctx context.Context, v ...any)

func (*Logger) Debugf

func (l *Logger) Debugf(ctx context.Context, format string, v ...any)

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, v ...any)

func (*Logger) Errorf

func (l *Logger) Errorf(ctx context.Context, format string, v ...any)

func (*Logger) Fatal

func (l *Logger) Fatal(ctx context.Context, v ...any)

func (*Logger) Fatalf

func (l *Logger) Fatalf(ctx context.Context, format string, v ...any)

func (*Logger) Info

func (l *Logger) Info(ctx context.Context, v ...any)

func (*Logger) Infof

func (l *Logger) Infof(ctx context.Context, format string, v ...any)

func (*Logger) JSONFormat

func (l *Logger) JSONFormat(level Level, message string) map[string]any

func (*Logger) Output

func (l *Logger) Output(level Level, message string)

func (*Logger) Panic

func (l *Logger) Panic(ctx context.Context, v ...any)

func (*Logger) Panicf

func (l *Logger) Panicf(ctx context.Context, format string, v ...any)

func (*Logger) Warn

func (l *Logger) Warn(ctx context.Context, v ...any)

func (*Logger) Warnf

func (l *Logger) Warnf(ctx context.Context, format string, v ...any)

func (*Logger) WithCaller

func (l *Logger) WithCaller(skip int) *Logger

func (*Logger) WithCallersFrames

func (l *Logger) WithCallersFrames() *Logger

func (*Logger) WithContext

func (l *Logger) WithContext(ctx context.Context) *Logger

func (*Logger) WithFields

func (l *Logger) WithFields(f Fields) *Logger

Jump to

Keyboard shortcuts

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