Documentation
¶
Index ¶
Constants ¶
View Source
const ( // For unrecoverable errors where you would be unable to continue the // current scope of code. LogError int = iota // For non-critical errors that do not require you to abort/exit from the // current scope of code. LogWarning // For non-error "informational" logging. LogInformational // For any type of verbose debug specific logging. LogDebug )
Error Levels that can be used to differentiate logged messages and also set the verbosity of logs to display.
Variables ¶
View Source
var ( // PrefixError is the custom prefix for errors PrefixError string // PrefixWarning is the custom prefix for warnings PrefixWarning string // PrefixInformational is the custom prefix for informational messages PrefixInformational string // PrefixDebug is the custom prefix for debug messages PrefixDebug string // Prefix is a string that is added to the start of any logged messages. Prefix string // LogLevel is the level of msgs to be logged. LogLevel int // Writer is the output io.Writer where messages are wrote to. Writer io.Writer )
Functions ¶
func Custom ¶
Custom formats and writes the provided message to the defined io.Writer output as long as the passed level is less than or equal to the Logger.LogLevel
out : io.Writer to output message to level : Log Level of the message being logged. calldepth : Distance from the caller format : Printf style message format a ... : comma separated list of values to pass (like Printf)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.