logger

package
v0.0.0-...-6b4cc3a Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VDebug = iota
	VVerbose
	VInfo
	VWarn
	VError
)

logging verbosity level enum

View Source
const (
	LMStd = iota
	LMFile
	LMBoth
)

logging mode

Variables

This section is empty.

Functions

func GetCurrentLogFile

func GetCurrentLogFile() *os.File

GetCurrentLogFile returns the current log file or nil if none.

func GetDebugLogger

func GetDebugLogger() *log.Logger

GetDebugLogger returns the log.Logger object used to output debug messages

func GetErrorLogger

func GetErrorLogger() *log.Logger

GetErrorLogger returns the log.Logger object used to output error messages

func GetInfoLogger

func GetInfoLogger() *log.Logger

GetInfoLogger returns the log.Logger object used to output info messages

func GetVerboseLogger

func GetVerboseLogger() *log.Logger

GetVerboseLogger returns the log.Logger object used to output verbose messages

func GetWarningLogger

func GetWarningLogger() *log.Logger

GetWarningLogger returns the log.Logger object used to output warning messages

func LogDebug

func LogDebug(format string, a ...interface{})

LogDebug outputs the given message to the debug log. It's arguments are the same as fmt.Printf()

func LogError

func LogError(format string, a ...interface{})

LogError outputs the given message to the error log. It's arguments are the same as fmt.Printf()

func LogInfo

func LogInfo(format string, a ...interface{})

LogInfo outputs the given message to the info log. It's arguments are the same as fmt.Printf()

func LogToFile

func LogToFile(verbosity int, logFilePath string)

LogToFile configures the loggers to output to the given log file. If the file exists, output is appended.

func LogToStd

func LogToStd(verbosity int)

LogToStd configures the loggers to direct log output to stdout

func LogToStdAndFile

func LogToStdAndFile(verbosity int, logFilePath string)

LogToStdAndFile configures the loggers to output both to stdout and the given log file.

func LogVerbose

func LogVerbose(format string, a ...interface{})

LogVerbose outputs the given message to the verbose log. It's arguments are the same as fmt.Printf()

func LogWarning

func LogWarning(format string, a ...interface{})

LogWarning outputs the given message to the warning log. It's arguments are the same as fmt.Printf()

func RotateLogFile

func RotateLogFile(rotateName string, compress bool) (<-chan bool, error)

RotateLogFile rotates the current log file. That is to say the current log file is closed, renamed, and compressed. Then a new log file is opened. params:

rotateName - the name that the current log file should be renamed to.
compress - if true the rotated log file is compressed.

return:

<-chan bool - channel that will be closed when gzip is complete. nil if no gzip compression or error.
error - any error that might have occured during log rotation

func VerbosityStringToEnum

func VerbosityStringToEnum(verbosity string) int

VerbosityStringToEnum converts a verbosity string in to its enumerator equivalent

Types

This section is empty.

Jump to

Keyboard shortcuts

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