package main

import (
	"context"
	"example.com/v2/logging"
	"log/slog"
	"os"
	"time"
)

func main() {
	var level slog.LevelVar
	log := logging.New(os.Stdout, &level).With("service", "quote")
	ctx := logging.WithRequestID(context.Background(), "req-42")
	log.DebugContext(ctx, "hidden")
	log.InfoContext(ctx, "context alone")
	logging.RequestLogger(ctx, log).InfoContext(ctx, "quote created", slog.Int("total", 500), slog.Any("api_key", logging.Secret("sample-only")), slog.Duration("elapsed", 1500*time.Millisecond))
	level.Set(slog.LevelDebug)
	log.Debug("debug enabled")
}
