Skip to content

BOOMfinity/golog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Reference

💫 Features

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

🛫 Quick start

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

Plugins are separate modules, install them individually.

Sentry Go Reference

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 + logs

Discord Go Reference

Sends logs to a Discord channel via webhooks.

go get github.com/BOOMfinity/golog/v3/plugins/dislog
log = log.WithHook(dislog.Init(webhookClient))

About

Zero allocation logger with colors written in go

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages