Skip to content

godeh/sloggergo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sloggergo

Go structured logger with zero dependencies by default.

Features

  • 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.

Usage

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")
}

Examples

Check the examples directory for more usage scenarios:

About

Go structured logger with zero dependencies by default.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages