mirror of
https://github.com/nxshock/simplelog.git
synced 2025-09-15 14:33:32 +05:00
No description
consts.go | ||
go.mod | ||
go.sum | ||
message.go | ||
README.md | ||
simplelog.go |
simplelog
Simple logging library for Go.
Usage
// Create logger
log := NewLogger(os.Stderr) // To terminal - with colorful messages
log := NewLogger(any io.Writer) // To file - without colors
// Print messages
log.Info("info message")
log.Warnf("warning message: %s is suspicious", "something")
log.Errorf("error message: %s", "something goes wrong")
log.Fatal("unacceptable")
// Progress message
for i:=0; i < 100; i++ {
log.Progressf("Processed %d records...", i)
}
log.Infof("Processed %d messages.")