logger

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package logger provides structured logging (slog) and context-aware logger retrieval for Genie.

It solves the problem of having a single place to configure log level, output format (JSON or text), and to attach loggers to context so that downstream code can use backend.Logger.FromContext(ctx) without passing a logger explicitly. GetLogger(ctx) returns the request-scoped logger when available, falling back to the default. Without this package, logging would be ad-hoc and inconsistent across components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorAttr

func ErrorAttr(err error) slog.Attr

func GetLogger

func GetLogger(ctx context.Context) *slog.Logger

func IsDebugEnabled

func IsDebugEnabled() bool

func LogLevel

func LogLevel() slog.Level

func SendJSONTo

func SendJSONTo(w io.Writer)

func SetLogHandler

func SetLogHandler(handler slog.Handler)

func SetLogLevel

func SetLogLevel(newLevel slog.Level)

func WithArgs

func WithArgs(ctx context.Context, args ...any) context.Context

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL