Files
core/logz/doc.go
T
Rene Nochebuena a7fa7fc51a docs(core): fix logz.Options -> logz.Config in doc examples; bump to v1.1.0
Coordinated framework release. Documentation-only code change plus the shared
version bump.

- core/launcher/doc.go, core/logz/doc.go: logz.New(logz.Options{...}) ->
  logz.Config (Options was retired per ADR-003; the constructor takes Config).
- go.mod: contracts -> v1.1.0 (via go get + go mod tidy).

Verified by compiling the example patterns against the real API. Badge -> v1.1.0.
2026-08-07 18:41:49 -06:00

28 lines
1.0 KiB
Go

// Package logz provides a structured, leveled logger backed by the standard
// library's log/slog package.
//
// logz.New returns a logging.Logger (from contracts). No concrete type is
// exported — callers depend on the interface, not the implementation.
//
// Error enrichment: when an error passed to Logger.Error implements
// errs.CodedError or errs.ContextualError (from contracts/errs), the
// corresponding fields are automatically appended to the log record without
// either package importing the other.
//
// Context enrichment: WithRequestID, WithField, and WithFields store values
// in context.Context. Logger.WithContext reads them back and attaches
// request_id and any extra fields to every subsequent log record.
//
// Usage:
//
// logger := logz.New(logz.Config{
// Level: slog.LevelDebug,
// JSON: true,
// StaticArgs: []any{"service", "api"},
// })
//
// ctx = logz.WithRequestID(ctx, requestID)
// reqLogger := logger.WithContext(ctx)
// reqLogger.Info("handling request", "path", r.URL.Path)
package logz