feat: set process-wide default logger for discord-bot
This commit is contained in:
parent
551a38db24
commit
c918c8674a
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
@ -31,6 +32,9 @@ func main() {
|
||||
}
|
||||
|
||||
log := logger.New(cfg.LogFormat, cfg.LogLevel)
|
||||
// Set the process-wide default so contexts created at library boundaries
|
||||
// still inherit the configured JSON/text handler.
|
||||
slog.SetDefault(log)
|
||||
log.Info("starting discord-bot",
|
||||
"version", version,
|
||||
"ha_gateway_addr", cfg.HAGatewayAddr,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user