logger

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func Debug

func Debug(message string)

func DebugC

func DebugC(component string, message string)

func DebugCF

func DebugCF(component string, message string, fields map[string]any)

func DebugF

func DebugF(message string, fields map[string]any)

func Debugf added in v0.2.3

func Debugf(message string, ss ...any)

func DisableFileLogging

func DisableFileLogging()

func EnableFileLogging

func EnableFileLogging(filePath string) error

func Error

func Error(message string)

func ErrorC

func ErrorC(component string, message string)

func ErrorCF

func ErrorCF(component string, message string, fields map[string]any)

func ErrorF

func ErrorF(message string, fields map[string]any)

func Errorf added in v0.2.3

func Errorf(message string, ss ...any)

func Fatal

func Fatal(message string)

func FatalC

func FatalC(component string, message string)

func FatalCF

func FatalCF(component string, message string, fields map[string]any)

func FatalF

func FatalF(message string, fields map[string]any)

func Fatalf added in v0.2.3

func Fatalf(message string, ss ...any)

func Info

func Info(message string)

func InfoC

func InfoC(component string, message string)

func InfoCF

func InfoCF(component string, message string, fields map[string]any)

func InfoF

func InfoF(message string, fields map[string]any)

func Infof added in v0.2.3

func Infof(message string, ss ...any)

func SetLevel

func SetLevel(level LogLevel)

func Warn

func Warn(message string)

func WarnC

func WarnC(component string, message string)

func WarnCF

func WarnCF(component string, message string, fields map[string]any)

func WarnF

func WarnF(message string, fields map[string]any)

Types

type LogLevel

type LogLevel = zerolog.Level

func GetLevel

func GetLevel() LogLevel

type Logger

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

Logger implements common Logger interface

func NewLogger added in v0.2.3

func NewLogger(component string) *Logger

NewLogger creates a new logger instance with optional component name

func (*Logger) Debug added in v0.2.3

func (b *Logger) Debug(v ...any)

Debug logs debug messages

func (*Logger) Debugf added in v0.2.3

func (b *Logger) Debugf(format string, v ...any)

Debugf logs formatted debug messages

func (*Logger) Error added in v0.2.3

func (b *Logger) Error(v ...any)

Error logs error messages

func (*Logger) Errorf added in v0.2.3

func (b *Logger) Errorf(format string, v ...any)

Errorf logs formatted error messages

func (*Logger) Fatalf added in v0.2.3

func (b *Logger) Fatalf(format string, v ...any)

Fatalf logs formatted fatal messages and exits

func (*Logger) Info added in v0.2.3

func (b *Logger) Info(v ...any)

Info logs info messages

func (*Logger) Infof added in v0.2.3

func (b *Logger) Infof(format string, v ...any)

Infof logs formatted info messages

func (*Logger) Log added in v0.2.3

func (b *Logger) Log(msgL, caller int, format string, a ...any)

Log logs a message at a given level with caller information the func name must be this because 3rd party loggers expect this msgL: message level (DEBUG, INFO, WARN, ERROR, FATAL) caller: unused parameter reserved for compatibility format: format string a: format arguments

func (*Logger) Sync added in v0.2.3

func (b *Logger) Sync() error

Sync flushes log buffer (no-op for this implementation)

func (*Logger) Warn added in v0.2.3

func (b *Logger) Warn(v ...any)

Warn logs warning messages

func (*Logger) Warnf added in v0.2.3

func (b *Logger) Warnf(format string, v ...any)

Warnf logs formatted warning messages

func (*Logger) Warningf added in v0.2.3

func (b *Logger) Warningf(format string, v ...any)

Warningf logs formatted warning messages

func (*Logger) WithLevels added in v0.2.3

func (b *Logger) WithLevels(levels map[int]LogLevel) *Logger

WithLevels sets log levels mapping for this logger

Jump to

Keyboard shortcuts

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