logger

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOG   = "      "
	INFO  = "INFO  "
	WARN  = "WARN  "
	ERROR = "ERROR "
	DEBUG = "DEBUG "
	FATAL = "FATAL "
)

Variables

View Source
var (
	Log = &Logger{
		DebugMode: false,
		NoColor:   false,
		Output:    os.Stdout,
	}
	FileLog *log.Logger
	LogFile *os.File
)

Functions

func CloseLogging added in v0.1.0

func CloseLogging()

func Debugf

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

func DisableColor added in v0.1.0

func DisableColor()

func Fatalf

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

func Infof

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

func Logf

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

func PurgeOldLogs added in v0.1.0

func PurgeOldLogs(dataFolder string, logsToKeep int) (err error)

func SetFileOutput added in v0.1.0

func SetFileOutput(fileName string)

func SetLogger

func SetLogger(debugMode bool)

func Warnf

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

Types

type Logger

type Logger struct {
	DebugMode bool
	NoColor   bool
	Output    io.Writer
}

Jump to

Keyboard shortcuts

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