Все просто, сторонние решения слишком сложные и тяжелые, а это... ну, мои задачи оно решает.
go get -u github.com/yuriygr/go-loggy
- Humble
- Colorful
- No dependencies
config := loggy.LoggerConfig{
Writer: os.Stderr,
TimeFormat: "2006-01-02 15:04:05",
}
logger := loggy.NewLogger(config)
logger.Success("Success text")
logger.Info("Info text")
logger.Notice("Notice text")
logger.Warning("Warning text")
logger.Error("Error text")
logger.Debug("Debug text")