logger

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package logger provides a thin wrapper around zerolog so that other internal packages do not import zerolog directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContext

func WithContext(ctx context.Context, l Logger) context.Context

WithContext returns a new context that carries l.

Types

type Logger

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

Logger wraps zerolog.Logger.

func FromContext

func FromContext(ctx context.Context) Logger

FromContext extracts the Logger from ctx, returning Nop() if absent.

func New

func New(zl zerolog.Logger) Logger

New creates a Logger from a zerolog.Logger.

func Nop

func Nop() Logger

Nop returns a disabled Logger that discards all output.

func Setup

func Setup(level, format string) Logger

Setup creates a configured Logger based on level and format strings. Supported levels: debug, info, warn, error. Supported formats: json, pretty.

func (Logger) Debug

func (l Logger) Debug() *zerolog.Event

Debug starts a new message with debug level.

func (Logger) Error

func (l Logger) Error() *zerolog.Event

Error starts a new message with error level.

func (Logger) Fatal

func (l Logger) Fatal() *zerolog.Event

Fatal starts a new message with fatal level. The message will call os.Exit(1) after being sent.

func (Logger) Info

func (l Logger) Info() *zerolog.Event

Info starts a new message with info level.

func (Logger) Warn

func (l Logger) Warn() *zerolog.Event

Warn starts a new message with warn level.

Jump to

Keyboard shortcuts

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