refactor: make logger global and improve initialization
This commit is contained in:

committed by
Grail Finder (aider)

parent
081bfdee0f
commit
e4b8480d28
@ -7,11 +7,13 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var log *slog.Logger
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
handler := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{
|
// it should print code line where call is occured; ai!
|
||||||
|
log = slog.New(slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{
|
||||||
Level: slog.LevelDebug,
|
Level: slog.LevelDebug,
|
||||||
})
|
}))
|
||||||
slog = slog.New(handler)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var roundWords = map[string]string{
|
var roundWords = map[string]string{
|
||||||
|
Reference in New Issue
Block a user