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 config.Current.Debug = false defer restoreDebug() 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 config.Current.Debug = true defer restoreDebug() 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 config.Current.Verbose = false defer restoreVerbose() 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 config.Current.Verbose = true defer restoreVerbose() Info(logString)
Output: Info String!
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.