logging

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package logging provides application-wide logging configuration.

Index

Constants

View Source
const (
	LevelTrace = "trace"
	LevelDebug = "debug"
	LevelInfo  = "info"
	LevelWarn  = "warn"
	LevelError = "error"
)

Variables

This section is empty.

Functions

func Ctx

func Ctx(ctx context.Context) *zerolog.Logger

Ctx returns the logger associated with the context.

func DebugEnabled

func DebugEnabled() bool

DebugEnabled reports whether debug logging is enabled.

func Init

func Init(setters ...OptOptionsSetter) error

Init initializes the global logger for zerolog and configures slog for third-party libraries.

func TraceEnabled

func TraceEnabled() bool

TraceEnabled reports whether trace logging is enabled.

Types

type OptOptionsSetter

type OptOptionsSetter func(o *Options)

func WithJson

func WithJson(opt bool) OptOptionsSetter

func WithLevel

func WithLevel(opt string) OptOptionsSetter

type Options

type Options struct {
	// contains filtered or unexported fields
}

func NewOptions

func NewOptions(
	options ...OptOptionsSetter,
) Options

func (*Options) Validate

func (o *Options) Validate() error

Jump to

Keyboard shortcuts

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