commonlog

package
v22.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// LogLevelFnMap is a map between loglevel and log functions from logrus
	LogLevelFnMap = func(ctx context.Context, lev logrus.Level) func(args ...interface{}) {
		lm := map[logrus.Level]func(args ...interface{}){
			logrus.TraceLevel: logrus.WithContext(ctx).Trace,
			logrus.DebugLevel: logrus.WithContext(ctx).Debug,
			logrus.InfoLevel:  logrus.WithContext(ctx).Info,
			logrus.WarnLevel:  logrus.WithContext(ctx).Warn,
			logrus.ErrorLevel: logrus.WithContext(ctx).Error,
		}
		return lm[lev]
	}
)

Functions

This section is empty.

Types

type MyFormatter

type MyFormatter struct {
	logrus.TextFormatter
	// contains filtered or unexported fields
}

MyFormatter ...

func GetDefaultFormatter

func GetDefaultFormatter() *MyFormatter

GetDefaultFormatter returns the default formatter used by all Safescale modules

func (*MyFormatter) Format

func (f *MyFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format ...

Jump to

Keyboard shortcuts

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