feat: initial shared logging module
slog SetupLogger (text/json/otel), context logger helpers, MockLogger test helper, and a request-logger HTTP middleware sub-package. Replaces the logging package + middleware request-logger copied across the backend services.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# logging
|
||||
|
||||
Shared logging primitives for Shiny backend services.
|
||||
|
||||
- `SetupLogger(level, format, service, version)` — configures the slog default
|
||||
logger (text / json / otel) and returns it.
|
||||
- `ContextWithLogger` / `LoggerFromContext` — carry a logger on the context.
|
||||
- `NewMockLogger()` — test helper for asserting log output.
|
||||
- `logging/middleware.RequestLogger(logger)` — HTTP middleware that debug-logs
|
||||
request/response bodies.
|
||||
|
||||
Replaces the `logging` package (and the `middleware` request-logger) copied
|
||||
into the backend services.
|
||||
Reference in New Issue
Block a user