logger

package
v0.0.0-...-13c43de Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

the backend logger

Functions

func DPanic

func DPanic(args ...interface{})

never run in panic

func DPanicf

func DPanicf(template string, args ...interface{})

but if panic make a formatted string

func Debug

func Debug(args ...interface{})

write debug information

func Debugf

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

write debug information with a formatted string

func Error

func Error(args ...interface{})

get error message

func Errorf

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

format error message

func Fatal

func Fatal(args ...interface{})

fatal is horrifying

func Fatalf

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

horror with format :D

func Info

func Info(args ...interface{})

get information

func Infof

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

get formatted information

func InitLogger

func InitLogger(logger *LoggerConfig)

initialize the logger

func Panic

func Panic(args ...interface{})

Panic information

func Panicf

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

formated panic

func Warn

func Warn(args ...interface{})

warning

func Warnf

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

formatted warning

Types

type LoggerConfig

type LoggerConfig struct {
	FileName string `mapstructure:"path"`     // filepath
	Size     int    `mapstructure:"max"`      // maximum size of file in megabyte
	Backups  int    `mapstructure:"backups"`  // number of backup files
	Age      int    `mapstructure:"age"`      // age of a file in days
	Compress bool   `mapstructure:"compress"` // compress the files
	Level    string `mapstructure:"level"`    // set the log level default is error
}

configure the logging

var LoggingConfig *LoggerConfig

global logger configuration

func DefaultLoggingConfig

func DefaultLoggingConfig() *LoggerConfig

build a default configuration

func InitLoggerConfig

func InitLoggerConfig(filepath, loglevel string, sizeoffile, numberofbackups, ageoffile int, compress bool) *LoggerConfig

build a logger configuration

Jump to

Keyboard shortcuts

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