- Dynamically config log level
- Output debug/info/notice messages to stdout, and output warn/error mssages to stdout/stderr
- Customize log output
package main
import (
"github.com/zhouruisong/go-level-logger"
)
func main() {
logger.InitLogger(logger.LogLevelDebug)
logger.Debugf("debug message")
logger.Infof("info message")
logger.Noticef("notice message")
logger.Warnf("warn message")
logger.Errorf("error message")
}
package main
import (
"github.com/zhouruisong/go-level-logger"
)
func main() {
logger.Init(logger.LogLevelDebug, "example", "/tmp", 100, 3, 365)
logger.Debugf("debug message")
logger.Infof("info message")
logger.Noticef("notice message")
logger.Warnf("warn message")
logger.Errorf("error message")
}