logging

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 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 logging configures the process-wide slog default logger and provides thin context-aware helpers used across the service.

The helpers mirror log/slog with one addition: Error and Fatal take the error as a positional argument, keeping call sites compact.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, msg string, kv ...any)

Debug logs at debug level with alternating key-value pairs.

func Error

func Error(ctx context.Context, msg string, err error, kv ...any)

Error logs at error level. err may be nil (e.g. a fallback taken without a concrete error); it is then omitted from the attributes.

func Fatal

func Fatal(ctx context.Context, msg string, err error, kv ...any)

Fatal logs at error level and exits the process. Use only from main/boot paths.

func Info

func Info(ctx context.Context, msg string, kv ...any)

Info logs at info level with alternating key-value pairs.

func Setup

func Setup(level, format string)

Setup installs the default slog logger. level: debug | info | warn | error (default info). format: json (default) | text — text is convenient for local development.

func Warn

func Warn(ctx context.Context, msg string, kv ...any)

Warn logs at warn level with alternating key-value pairs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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