package
0.0.0-20160914140844-13f918f98fbc
Repository: https://github.com/hailooss/go-hailo-lib.git
Documentation: pkg.go.dev
# README
Log Package
This package is a drop-in replacement for seelog that allows you to add a source and context to your logging messages.
Usage
Set log.Source at the start of your program. This will prefix all log messages with @source:
log.Source = "foo"
log.Infof("found it: %s", xyz)
outputs:
@foo found it: xyz
When you want to report a topic for every log message, create a new context and use that as your logger:
log.Source = "foo"
clog := log.NewContext("myid")
clog.Debugf("received request: %s", xyz)
outputs:
@foo #myid received request: xyz
You can also create sub-contexts:
sublog := clog.NewContext("process")
sublog.Debugf("doing something")
outputs:
@foo #myid #process doing something
# Functions
Critical formats message using the default formats for its operands and writes to default logger with log level = Critical.
Criticalf formats message according to format specifier and writes to default logger with log level = Critical.
Debug formats message using the default formats for its operands and writes to default logger with log level = Debug.
Debugf formats message according to format specifier and writes to default logger with log level = Debug.
No description provided by the author
Error formats message using the default formats for its operands and writes to default logger with log level = Error.
Errorf formats message according to format specifier and writes to default logger with log level = Error.
Flush immediately processes all currently queued messages and all currently buffered messages.
Info formats message using the default formats for its operands and writes to default logger with log level = Info.
Infof formats message according to format specifier and writes to default logger with log level = Info.
No description provided by the author
Trace formats message using the default formats for its operands and writes to default logger with log level = Trace.
Tracef formats message according to format specifier and writes to default logger with log level = Trace.
Warn formats message using the default formats for its operands and writes to default logger with log level = Warn.
Warnf formats message according to format specifier and writes to default logger with log level = Warn.
# Variables
No description provided by the author