monitoring

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int

LogLevel represents the logging level

const (
	DEBUG LogLevel = iota
	INFO
	WARNING
	ERROR
)

type Logger

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

Logger provides structured logging functionality

func GetGlobalLogger

func GetGlobalLogger() *Logger

GetGlobalLogger returns the global logger instance

func NewLogger

func NewLogger() *Logger

NewLogger creates a new logger instance

func (*Logger) Debug

func (l *Logger) Debug(format string, v ...interface{})

Debug logs a debug message

func (*Logger) Error

func (l *Logger) Error(format string, v ...interface{})

Error logs an error message

func (*Logger) GetLogLevel

func (l *Logger) GetLogLevel() LogLevel

GetLogLevel returns the current log level

func (*Logger) GetStats

func (l *Logger) GetStats() map[string]interface{}

GetStats returns logger statistics

func (*Logger) GetUptime

func (l *Logger) GetUptime() time.Duration

GetUptime returns the uptime of the logger

func (*Logger) Info

func (l *Logger) Info(format string, v ...interface{})

Info logs an info message

func (*Logger) LogError

func (l *Logger) LogError(err error, context string)

LogError logs an error with context

func (*Logger) LogRequest

func (l *Logger) LogRequest(method, path, remoteAddr string, statusCode int, duration time.Duration)

LogRequest logs an HTTP request

func (*Logger) SetLogLevel

func (l *Logger) SetLogLevel(level LogLevel)

SetLogLevel sets the minimum log level

func (*Logger) SetLogLevelFromString

func (l *Logger) SetLogLevelFromString(levelStr string) error

SetLogLevelFromString sets the log level from a string

func (*Logger) Warning

func (l *Logger) Warning(format string, v ...interface{})

Warning logs a warning message

func (*Logger) WithField

func (l *Logger) WithField(key, value string) *Logger

WithField creates a new logger with an additional field (simplified implementation)

Jump to

Keyboard shortcuts

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