logging

package
v0.0.0-...-a53552e Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields ...map[string]interface{})

Debug logs a debug message using the global logger

func Debugf

func Debugf(format string, args ...interface{})

Debugf logs a formatted debug message using the global logger

func Error

func Error(msg string, fields ...map[string]interface{})

Error logs an error message using the global logger

func Errorf

func Errorf(format string, args ...interface{})

Errorf logs a formatted error message using the global logger

func Fatal

func Fatal(msg string, fields ...map[string]interface{})

Fatal logs a fatal message using the global logger and exits

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf logs a formatted fatal message using the global logger and exits

func Info

func Info(msg string, fields ...map[string]interface{})

Info logs an info message using the global logger

func Infof

func Infof(format string, args ...interface{})

Infof logs a formatted info message using the global logger

func InitLogger

func InitLogger() error

InitLogger initializes the global logger with config

func Warn

func Warn(msg string, fields ...map[string]interface{})

Warn logs a warning message using the global logger

func Warnf

func Warnf(format string, args ...interface{})

Warnf logs a formatted warning message using the global logger

Types

type LogLevel

type LogLevel int

LogLevel represents the severity of a log message

const (
	DEBUG LogLevel = iota
	INFO
	WARN
	ERROR
	FATAL
)

func ParseLogLevel

func ParseLogLevel(level string) LogLevel

ParseLogLevel converts a string to LogLevel

func (LogLevel) String

func (l LogLevel) String() string

String returns the string representation of the log level

type Logger

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

Logger represents our custom logger

func GetLogger

func GetLogger() *Logger

GetLogger returns the global logger instance

func NewBasicLogger

func NewBasicLogger() (*Logger, error)

NewBasicLogger creates a basic logger for fallback

func NewLogger

func NewLogger() (*Logger, error)

NewLogger creates a new logger instance using the global config

func (*Logger) Close

func (l *Logger) Close() error

Close closes the logger and any open files

func (*Logger) Debug

func (l *Logger) Debug(msg string, fields ...map[string]interface{})

Debug logs debug level messages

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...interface{})

Debugf logs debug level messages with formatting

func (*Logger) Error

func (l *Logger) Error(msg string, fields ...map[string]interface{})

Error logs error level messages

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

Errorf logs error level messages with formatting

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, fields ...map[string]interface{})

Fatal logs fatal level messages and exits

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, args ...interface{})

Fatalf logs fatal level messages with formatting and exits

func (*Logger) Info

func (l *Logger) Info(msg string, fields ...map[string]interface{})

Info logs info level messages

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...interface{})

Infof logs info level messages with formatting

func (*Logger) Warn

func (l *Logger) Warn(msg string, fields ...map[string]interface{})

Warn logs warning level messages

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...interface{})

Warnf logs warning level messages with formatting

Jump to

Keyboard shortcuts

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