Documentation
¶
Index ¶
Constants ¶
View Source
const (
NO_FILE = "true"
)
Variables ¶
This section is empty.
Functions ¶
func GetTimeFromLine ¶ added in v1.3.22
GetTimeFromLine ...
Types ¶
type Logger ¶ added in v1.3.0
type Logger interface { Debug(msg string, ctx ...interface{}) Info(msg string, ctx ...interface{}) Warn(msg string, ctx ...interface{}) Error(msg string, ctx ...interface{}) Crit(msg string, ctx ...interface{}) }
Logger writes key/pair values to a handler
func Init ¶
Init instantiates the logger with the specified arguments.
The first `args` parameter is the logger filename (default: logger.log).
The second `args` parameter indicates whether to get rid of any file logging (default: "false"). You might want to use the `logger.NO_FILE` constant as this second parameter or the string "true", eg.
log := logger.Init("my_package", "MyFunction", "", logger.NO_FILE)
IMPORTANT: The logger will log to stderr and to the file unless stated otherwise.
func InitHandler ¶
InitHandler is generally used in API handlers to display the request ID.
IMPORTANT: The logger will log to stderr and to the file.
Click to show internal directories.
Click to hide internal directories.