Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

livebud/log

Repository files navigation

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