A minimalist logging library for Go. Inspired by Charm Log.
Features:
- Colored and human readable output.
- Multiple log levels (Debug, Info, Success, Warn, Error, Fatal).
- Customizable time format.
- Toggleable report caller.
- Toggleable debug mode.
Use go get
to install the package.
go get github.com/zenitria/zenlog@latest
Import package to your project.
import "github.com/zenitria/zenlog"
zenlog.Debug("Debug message") // Works only in debug mode
zenlog.Info("Info message")
zenlog.Success("Success message")
zenlog.Warning("Warning message")
zenlog.Error("Error message")
zenlog.Fatal("Fatal message") // Exits with code 1
zenlog.Debugf("Debug message with %s", "formatting") // Works only in debug mode
zenlog.Infof("Info message with %s", "formatting")
zenlog.Successf("Success message with %s", "formatting")
zenlog.Warningf("Warning message with %s", "formatting")
zenlog.Errorf("Error message with %s", "formatting")
zenlog.Fatalf("Fatal message with %s", "formatting") // Exits with code 1
zenlog.SetTimeFormat("YOUR TIME FORMAT") // Default: 2006-01-02 15:04:05
zenlog.SetDebug(true) // Default: false
zenlog.SetReportCaller(true) // Default: false