diff --git a/logging.go b/logging.go new file mode 100644 index 00000000..924e3a7c --- /dev/null +++ b/logging.go @@ -0,0 +1,48 @@ +package main + +import ( + log "github.com/cihub/seelog" +) + +func init() { + + SetLogLevel("debug") +} + +// SetLogLevel determines the log level +func SetLogLevel(level string) (err error) { + + // https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit + // https://github.com/cihub/seelog/wiki/Log-levels + appConfig := ` + + + + + + + + + + + + + + + + + + + + + + + + ` + logger, err := log.LoggerFromConfigAsBytes([]byte(appConfig)) + if err != nil { + return + } + log.ReplaceLogger(logger) + return +}