Fast: ~300 ns/op, zero allocations on the hot path
Configurable: independent formatter, hooks, level per instance
Batteries included: pretty and JSON output, Sentry & Discord plugins
Hierarchical: modules and scopes for structured output
go get github.com/BOOMfinity/golog/v3
golog.Info().Msg("Hello World!")
golog.Error().Cause(err).Msg("something broke")
db := golog.Default().Module("db", "queries")
db.Info().Attr("duration", "12ms").Msg("SELECT users")Plugins are separate modules, install them individually.
Captures exceptions and forwards logs to sentry.io.
go get github.com/BOOMfinity/golog/v3/plugins/sentrylog
log = log.WithHook(sentrylog.Init(true, true)) // exceptions + logsSends logs to a Discord channel via webhooks.
go get github.com/BOOMfinity/golog/v3/plugins/dislog
log = log.WithHook(dislog.Init(webhookClient))