feat: configure structured JSON logging with debug level
This commit is contained in:
@ -4,11 +4,14 @@ import (
|
|||||||
"html/template"
|
"html/template"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// init slog to be at level debug and us json structured logs; ai!
|
handler := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{
|
||||||
slog = slog.New()
|
Level: slog.LevelDebug,
|
||||||
|
})
|
||||||
|
slog = slog.New(handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
var roundWords = map[string]string{
|
var roundWords = map[string]string{
|
||||||
|
Reference in New Issue
Block a user