An open API service indexing awesome lists of open source software.

https://github.com/kevinburke/slogdefault

Make log/slog's default Handler customizable
https://github.com/kevinburke/slogdefault

go logging

Last synced: over 1 year ago
JSON representation

Make log/slog's default Handler customizable

Awesome Lists containing this project

README

          

# slogdefault

This is a trivial library that exposes the standard library's
`log/slog.Default()` and makes it customizable.

### Usage

```go
h := slogdefault.NewHandler(output, &slog.HandlerOptions{/* ... */}
logger := slog.New(h)
logger.Info("test message")
```

Use this to add source lines, change the log level, chain handlers, etc.