Documentation
¶
Overview ¶
Package logging provides the application's structured logger, built on the standard library's log/slog. It offers leveled, component-tagged, key=value logging with a compact human-readable text format (the default) or JSON.
Configuration is environment-driven and applied once via Setup:
STREMIO_LOG_LEVEL debug | info | warn | error (default: info) STREMIO_LOG_FORMAT text | json (default: text)
Subsystems obtain a tagged logger with For("engine"), which stamps every record with component=engine so output can be filtered and read at a glance:
2026-06-27T12:00:37.700Z INFO engine: disk piece cache path=/var/cache size=0
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fatal ¶
Fatal logs msg at error level with the given key=value args, then exits the process with status 1. It is the structured replacement for log.Fatalf.
Types ¶
type ResponseRecorder ¶
type ResponseRecorder struct {
http.ResponseWriter
Status int
Bytes int64
}
ResponseRecorder wraps an http.ResponseWriter to capture the response status code and the number of body bytes written, for access logging. It forwards Flush so streaming responses are unaffected, and exposes the underlying writer via Unwrap for any further interface probing.
func NewResponseRecorder ¶
func NewResponseRecorder(w http.ResponseWriter) *ResponseRecorder
NewResponseRecorder wraps w. Status defaults to 200 if the handler writes a body without an explicit WriteHeader.
func (*ResponseRecorder) Flush ¶
func (r *ResponseRecorder) Flush()
Flush forwards to the underlying writer when it supports http.Flusher; it is a no-op otherwise so callers can always rely on the method existing.
func (*ResponseRecorder) StatusOrOK ¶
func (r *ResponseRecorder) StatusOrOK() int
StatusOrOK returns the recorded status, defaulting to 200 when the handler completed without ever writing a header or body.
func (*ResponseRecorder) Unwrap ¶
func (r *ResponseRecorder) Unwrap() http.ResponseWriter
Unwrap returns the wrapped writer (used by http.ResponseController and tests).
func (*ResponseRecorder) WriteHeader ¶
func (r *ResponseRecorder) WriteHeader(code int)