livebud / log

Simple structured logger for Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Log

Go Reference

Simple logger for Go.

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

About

Simple structured logger for Go.

License:MIT License


Languages

Language:Go 97.2%Language:Makefile 2.8%