/log

Simple structured logger for Go.

Primary LanguageGoMIT LicenseMIT

Log

Go Reference

Simple logger for Go.

⚠️ Deprecated in favor of: https://github.com/matthewmueller/logs.

log

Features

  • Pretty console handler for terminals
  • Adds a level filter handler
  • json and logfmt handlers
  • Adds a multi-logger

Install

go get github.com/livebud/log

Example

log := log.Multi(
  log.Filter(log.LevelInfo, log.Console(color.Ignore(), os.Stderr)),
  log.Json(os.Stderr),
)
log.Debug("world", "args", 10)
log.Info("hello", "planet", "world", "args", 10)
log.Warn("hello", "planet", "world", "args", 10)
log.Error("hello world", "planet", "world", "args", 10)

Contributors

License

MIT