log

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

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Debugf

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

func Debugln

func Debugln(args ...interface{})

func Dup

func Dup(from, to int) error

func EnableFnTrace

func EnableFnTrace()

func Error

func Error(args ...interface{})

func Errorf

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

func Errorln

func Errorln(args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

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

func Fatalln

func Fatalln(args ...interface{})

func GetLevel

func GetLevel() string

func GetLogger

func GetLogger(ctx context.Context, pkg, fnName string) *logrus.Entry

func Info

func Info(args ...interface{})

func Infof

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

func Infoln

func Infoln(args ...interface{})

func LogInit

func LogInit()

func New

func New() *logrus.Entry

New create logger instance with request_id as a field also set the default format to JSON.

func Print

func Print(args ...interface{})

func Printf

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

func Println

func Println(args ...interface{})

func Request

func Request(next http.Handler) http.Handler

func SetLevel

func SetLevel(level string)

func Warn

func Warn(args ...interface{})

func Warnf

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

func Warnln

func Warnln(args ...interface{})

func WithContext

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

func WithError

func WithError(err error) *logrus.Entry

func WithFields

func WithFields(fields Fields) *logrus.Entry

Types

type Fields

type Fields logrus.Fields

type WriterHook

type WriterHook struct {
	Writer    io.Writer
	LogLevels []logrus.Level
}

WriterHook is a hook that writes logs of specified LogLevels to specified Writer

func (*WriterHook) Fire

func (hook *WriterHook) Fire(entry *logrus.Entry) error

Fire will be called when some logging function is called with current hook It will format log entry to string and write it to appropriate writer

func (*WriterHook) Levels

func (hook *WriterHook) Levels() []logrus.Level

Levels define on which log levels this hook would trigger

Jump to

Keyboard shortcuts

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