Documentation ¶
Overview ¶
Package logger provides logging capability for an application or service. TODO: make this its own go module outside of cleanpg
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogToStderr ¶
func LogToStderr(flag bool)
LogToStderr determines whether log messages will print to stderr as well as the log file
func SetLogFile ¶
func SetLogFile(fileName string)
SetLogFile sets the name of the log file. If not set, the default filename is "log.txt"
func Write ¶
func Write(messageType MessageType, format string, a ...interface{})
Write is a function which writes a variable length string message to the log file
Types ¶
type MessageType ¶
type MessageType int
MessageType holds the log level of the message. Possible values: INFO | NOTICE | WARNING | ERROR | FATAL
const ( // INFO indicates generally useful information INFO MessageType = 0 // NOTICE indicates program state changes that are not abnormal NOTICE MessageType = iota // WARNING indicates application oddities that are recoverable WARNING // ERROR indicates condition fatal to the operation // but not to the application ERROR // FATAL indicates condition is fatal to the application or service // and will force a shutdown FATAL )
Click to show internal directories.
Click to hide internal directories.