log

package
v0.0.0-...-3442dc8 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLogFormat = TextFormat
View Source
const DefaultLogOutput = StdErrOutput
View Source
const DefaultOutputParallelLimit = 5
View Source
const TimestampFormat = "2006-01-02T15:04:05.000000000Z07:00"

Variables

This section is empty.

Functions

func SetGlobalLevel

func SetGlobalLevel(level logcomm.LogLevel)

Types

type LogFormat

type LogFormat uint8
const (
	TextFormat LogFormat = iota
	JSONFormat
)

func (LogFormat) String

func (l LogFormat) String() string

type LogOutput

type LogOutput uint8
const (
	StdErrOutput LogOutput = iota
	FileLogOutput
	SysLogOutput
)

func (LogOutput) String

func (o LogOutput) String() string

type Logger

type Logger interface {
	//log a message at a trace level
	Trace(msg string)
	//log a formatted message at a trace level
	Tracef(string, ...interface{})
	//log a message at an info level
	Info(msg string)
	//log a formatted message at an info level
	Infof(string, ...interface{})
	//log a message at a debug level
	Debug(msg string)
	//log a formatted message at a debug level
	Debugf(string, ...interface{})
	//log a message at a warn level
	Warn(msg string)
	//log a formatted message at a warn level
	Warnf(string, ...interface{})
	//log a message at an error level
	Error(msg string)
	//log a formatted message at an error level
	Errorf(string, ...interface{})
	//log a message at a fatal level
	Fatal(msg string)
	//log a formatted message at a info level
	Fatalf(string, ...interface{})
	//log a message at a panic level
	Panic(msg string)
	//log a formatted message at a panic level
	Panicf(string, ...interface{})

	//update the logger level
	UpdateLoggerLevel(level logcomm.LogLevel)
}

func CreateMainLogger

func CreateMainLogger(level logcomm.LogLevel, format LogFormat, output LogOutput, param string) (Logger, error)

func CreateModuleLogger

func CreateModuleLogger(level logcomm.LogLevel, module string, l Logger) Logger

func CreateSubModuleLogger

func CreateSubModuleLogger(subModule string, l Logger) Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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