logger

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Logger is the global logger instance

Functions

func FromContext

func FromContext(ctx context.Context) zerolog.Logger

FromContext retrieves the logger from context, or returns the global logger if not found

func Get

func Get() zerolog.Logger

Get returns the global logger instance

func Init

func Init(level string, format string, logFile string, noColor bool) error

Init initializes the global logger with the specified configuration

func SetTestMode

func SetTestMode(enabled bool)

SetTestMode enables or disables test mode In test mode, all log output is suppressed

func WithDatabase

func WithDatabase(database string) zerolog.Logger

WithDatabase creates a sub-logger with database field

func WithLogger

func WithLogger(ctx context.Context, logger zerolog.Logger) context.Context

WithLogger adds a logger to the context

func WithOperation

func WithOperation(operation string) zerolog.Logger

WithOperation creates a sub-logger with operation field

func WithTable

func WithTable(table string) zerolog.Logger

WithTable creates a sub-logger with table field

Types

This section is empty.

Jump to

Keyboard shortcuts

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