Skip to content

Commit

Permalink
fix: slog default logger should be debug
Browse files Browse the repository at this point in the history
  • Loading branch information
morlay committed Sep 11, 2023
1 parent b28415b commit dd6ceb3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/otel/span_export__slog.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ func Source(skip int) *slog.Source {

func NewLogger() *slog.Logger {
if os.Getenv("GOENV") == "DEV" {
return slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{}))
return slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{
Level: slog.LevelDebug,
}))
}
return slog.New(slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{}))
return slog.New(slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{
Level: slog.LevelDebug,
}))
}

func SlogSpanExporter(log *slog.Logger) sdktrace.SpanExporter {
Expand Down

0 comments on commit dd6ceb3

Please sign in to comment.