logging

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetZeroLogJsonEnabled

func SetZeroLogJsonEnabled()

func WithLevel

func WithLevel(level string) func(*ZeroLogger)

WithLevel creates a new ZeroLogger with the specified level

Types

type Logger

type Logger interface {
	Info(ctx context.Context, msg string, fields map[string]interface{})
	Warn(ctx context.Context, msg string, fields map[string]interface{})
	Error(ctx context.Context, msg string, fields map[string]interface{})
	Debug(ctx context.Context, msg string, fields map[string]interface{})
}

Logger is an interface for logging

type ZeroLogger

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

ZeroLogger implements Logger using zerolog

func New

func New() *ZeroLogger

New creates a new ZeroLogger

func (*ZeroLogger) Debug

func (l *ZeroLogger) Debug(ctx context.Context, msg string, fields map[string]interface{})

Debug logs a debug message

func (*ZeroLogger) Error

func (l *ZeroLogger) Error(ctx context.Context, msg string, fields map[string]interface{})

Error logs an error message

func (*ZeroLogger) Info

func (l *ZeroLogger) Info(ctx context.Context, msg string, fields map[string]interface{})

Info logs an info message

func (*ZeroLogger) Warn

func (l *ZeroLogger) Warn(ctx context.Context, msg string, fields map[string]interface{})

Warn logs a warning message

Jump to

Keyboard shortcuts

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