Documentation
¶
Overview ¶
Package logging provides a simple logging infrastructure for the observability plugin It supports file-based logging with different levels and structured output
Index ¶
- func Debug(component, format string, args ...interface{})
- func Error(component, format string, args ...interface{})
- func Info(component, format string, args ...interface{})
- func SetGlobalLogger(logger *Logger)
- func Warn(component, format string, args ...interface{})
- type Config
- type LogLevel
- type Logger
- func (l *Logger) Close() error
- func (l *Logger) Component(component string) *Logger
- func (l *Logger) Debug(component, format string, args ...interface{})
- func (l *Logger) Error(component, format string, args ...interface{})
- func (l *Logger) Info(component, format string, args ...interface{})
- func (l *Logger) SetLevel(level LogLevel)
- func (l *Logger) Warn(component, format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(component, format string, args ...interface{})
Debug logs a debug message using the global logger
func Error ¶
func Error(component, format string, args ...interface{})
Error logs an error message using the global logger
func Info ¶
func Info(component, format string, args ...interface{})
Info logs an info message using the global logger
func SetGlobalLogger ¶
func SetGlobalLogger(logger *Logger)
SetGlobalLogger sets the global logger instance
Types ¶
type Config ¶
type Config struct {
LogFile string `yaml:"logFile" json:"logFile"`
Level string `yaml:"level" json:"level"`
Component string `yaml:"component" json:"component"`
LogToConsole bool `yaml:"logToConsole" json:"logToConsole"`
}
Config contains logger configuration
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default logging configuration
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides structured logging for the observability plugin
func GetGlobalLogger ¶
func GetGlobalLogger() *Logger
GetGlobalLogger returns the global logger instance, creating it if necessary
Click to show internal directories.
Click to hide internal directories.