Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(logStrings ...interface{})
Debug logs a string as DEBUG We write to disk if debug is true
Example (Off) ¶
ExampleDebug_off tests the output of a log sent to DEBUG while config.Debug is false
// Set up what we expect logString := "Debug String!" // Run the function without debug debug = false Debug(logString)
Output:
Example (On) ¶
ExampleDebug_on tests the output of a log sent to DEBUG while config.Debug is true
// Set up what we expect logString := "Debug String!" // Run the function with debug debug = true Debug(logString)
Output: Debug String!
func Error ¶
func Error(logStrings ...interface{})
Error logs a string a ERROR We print to stdout, write to disk, and then panic
Example ¶
ExampleError tests the output of a log sent to ERROR
// Set up what we expect logString := "Error String!" // Prepare to recover from a panic defer func() { recover() }() // Run the function Error(logString)
Output:
func Info ¶
func Info(logStrings ...interface{})
Info logs a string as INFO We only print to stdout if verbose is true
Example (Verbose_off) ¶
ExampleInfo_verbose_off tests the output of a log sent to INFO while config.Verbose is false
// Set up what we expect logString := "Info String!" // Run the function without verbose verbose = false Info(logString)
Output:
Example (Verbose_on) ¶
ExampleInfoVerboseOn tests the output of a log sent to INFO while config.Verbose is true
// Set up what we expect logString := "Info String!" // Run the function with verbose verbose = true Info(logString)
Output: Info String!
func NewLog ¶
func NewLog(cfg config.Configuration)
NewLog creates a file and points a new logging instance at it
Types ¶
This section is empty.