logger

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseLogger *logrus.Logger

Log is the global logger

Functions

func InitLogger

func InitLogger(cfg LoggingConfig)

InitLogger Initialize a new logger and set it as the global logger

func InitMiniLogger added in v0.15.0

func InitMiniLogger(debug bool)

InitMiniLogger Initialize a new logger with minimal configuration

func Isatty

func Isatty() bool

Isatty Check if a TTY is attached

func Trace

func Trace() string

Trace returns a string with useful trace information used in error handling

Types

type LoggingConfig

type LoggingConfig struct {
	Debug        bool     // if true, log level will be set to DEBUG
	Logfile      string   // empty to disable logfile
	MaxSize      int      // rotate after x MB filesize
	MaxAge       int      // rotate evey x days
	Backup       int      // number of backups to keep
	PTLogLevel   string   // <DEBUG|INFO|WARNING|ERROR> or empty to disable PT logging
	PTAppName    string   // if empty name of executable will be used
	PTSourceHost string   // Which host should be shown in PaperTrail
	PTHost       string   // PaperTrail host
	PTPort       int      // PaperTrail port
	FieldsOrder  []string // order of fields in log output
}

LoggingConfig represents the configuration for the logging mechanism of the application.

Jump to

Keyboard shortcuts

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