Documentation ¶
Overview ¶
package golog implements logging functions that log errors to stderr and debug messages to stdout. Trace logging is also supported. Trace logs go to stdout as well, but they are only written if the program is run with environment variable "TRACE=true". A stack dump will be printed after the message if "PRINT_STACK=true".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOutputs ¶
func GetOutputs() *outputs
func ResetOutputs ¶
func ResetOutputs()
Types ¶
type Logger ¶
type Logger interface { // Debug logs to stdout Debug(arg interface{}) // Debugf logs to stdout Debugf(message string, args ...interface{}) // Error logs to stderr Error(arg interface{}) // Errorf logs to stderr Errorf(message string, args ...interface{}) // Fatal logs to stderr and then exits with status 1 Fatal(arg interface{}) // Fatalf logs to stderr and then exits with status 1 Fatalf(message string, args ...interface{}) // Trace logs to stderr only if TRACE=true Trace(arg interface{}) // Tracef logs to stderr only if TRACE=true Tracef(message string, args ...interface{}) // TraceOut provides access to an io.Writer to which trace information can // be streamed. If running with environment variable "TRACE=true", TraceOut // will point to os.Stderr, otherwise it will point to a ioutil.Discared. // Each line of trace information will be prefixed with this Logger's // prefix. TraceOut() io.Writer // IsTraceEnabled() indicates whether or not tracing is enabled for this // logger. IsTraceEnabled() bool // AsStdLogger returns an standard logger AsStdLogger() *log.Logger }
Click to show internal directories.
Click to hide internal directories.