Go structured logger with zero dependencies by default.
- Zero Dependency: Core library has 0 external dependencies.
- Extensible: Interface-based usage for Sinks and Formatters.
- Async Support: Native asynchronous logging with buffering.
- Observability Ready: Built-in support (via standard library HTTP) for Elasticsearch, Loki, and Datadog.
package main
import (
"github.com/godeh/sloggergo"
"github.com/godeh/sloggergo/sink"
)
func main() {
// Create a new logger writing to stdout
log := sloggergo.New(
sloggergo.WithLevel(sloggergo.InfoLevel),
sloggergo.WithSink(sink.NewStdout()),
)
defer log.Close()
log.Info("Hello world")
}Check the examples directory for more usage scenarios: