rdev/internal/logging/nop.go
jordan d69da6d627 feat: add structured logging infrastructure and SDLC extensions
Major changes:
- Add internal/logging package with field constants, context propagation,
  sensitive data auto-redaction, and per-component log levels
- Add worker timeout constants (TimeoutQuickOp, TimeoutHealthCheck, etc.)
- Extend SDLC with callback handlers, generate endpoints, and executor
- Add new cookbook trees for aeries and slackpath progression
- Add skeleton templates for queue, realtime, and microservices
- Add worker component template with async job processing
- Refactor services and handlers to use new logging infrastructure
- Split component.go into component_infra.go and component_listing.go

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:56:04 -07:00

25 lines
514 B
Go

package logging
import (
"io"
"log/slog"
)
// nopLogger is a singleton nop logger.
var nopLogger *Logger
// Nop returns a no-op logger that discards all output.
// Useful for testing or when logging is disabled.
func Nop() *Logger {
if nopLogger == nil {
handler := slog.NewJSONHandler(io.Discard, &slog.HandlerOptions{
Level: slog.LevelError + 1, // Higher than any level, so nothing logs
})
nopLogger = &Logger{
Logger: slog.New(handler),
config: DefaultConfig(),
}
}
return nopLogger
}