stimlog

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int32

Level is the Level of logging set in stim

const (

	//FatalLevel this is used to log an error that will cause fatal problems in the program
	FatalLevel Level = 0
	//WarnLevel is logging for interesting events that need to be known about but are not crazy
	WarnLevel    Level = 20
	InfoLevel    Level = 30
	VerboseLevel Level = 40
	//DebugLevel is used to debugging certain calls in Stim to see what is going on, usually only used for development
	DebugLevel Level = 50
	TraceLevel Level = 60
)

type Logger

type Logger interface {
	Debug(...interface{})
	Warn(...interface{})
	Fatal(...interface{})
}

type StimLogger

type StimLogger interface {
	Trace(...interface{})
	Debug(...interface{})
	Verbose(...interface{})
	Info(...interface{})
	Warn(...interface{})
	Fatal(...interface{})
	GetLogLevel() Level
}

StimLogger this struct is a generic logger used by stim packages

func GetLogger

func GetLogger() StimLogger

GetLogger gets a logger for logging in stim.

func GetLoggerWithPrefix added in v0.0.7

func GetLoggerWithPrefix(prefix string) StimLogger

GetLoggerWithPrefix gets a logger for logging in stim with a prefix.

type StimLoggerConfig added in v0.0.7

type StimLoggerConfig interface {
	SetLogger(Logger)
	SetLevel(Level)
	SetDateFormat(string)
	AddLogFile(string, Level) error
	RemoveLogFile(string)
	ForceFlush(bool)
	Flush()
	EnableLevelLogging(bool)
	EnableTimeLogging(bool)
}

func GetLoggerConfig added in v0.0.7

func GetLoggerConfig() StimLoggerConfig

Jump to

Keyboard shortcuts

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