log

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package log provides structured logging for bc using log/slog.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, args ...any)

Debug logs a debug message. Only shown when verbose is enabled.

func Error

func Error(msg string, args ...any)

Error logs an error message.

func Info

func Info(msg string, args ...any)

Info logs an info message.

func Logger

func Logger() *slog.Logger

Logger returns the underlying slog.Logger.

func SetFormat

func SetFormat(f string)

SetFormat sets the log output format ("text" or "json"). Default is "text". JSON format is useful for log aggregation tools.

func SetOutput

func SetOutput(w io.Writer)

SetOutput sets the output writer for the logger.

func SetVerbose

func SetVerbose(v bool)

SetVerbose enables or disables verbose (debug) logging.

func Warn

func Warn(msg string, args ...any)

Warn logs a warning message.

func With

func With(args ...any) *slog.Logger

With returns a logger with the given attributes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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