Documentation
¶
Index ¶
- func Debug(format string, args ...interface{})
- func Error(format string, args ...interface{})
- func Info(format string, args ...interface{})
- func Init(level Level, logPath string) error
- func InitWithConsole(level Level, logPath string, enableConsole bool) error
- func NewSlogHandler(l *Logger) slog.Handler
- func Warn(format string, args ...interface{})
- type Level
- type Logger
- func (l *Logger) Close() error
- func (l *Logger) Debug(format string, args ...interface{})
- func (l *Logger) Error(format string, args ...interface{})
- func (l *Logger) GetLevel() Level
- func (l *Logger) Info(format string, args ...interface{})
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) Warn(format string, args ...interface{})
- func (l *Logger) WithPrefix(prefix string) *Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(format string, args ...interface{})
Debug logs a debug message using the global logger
func Error ¶
func Error(format string, args ...interface{})
Error logs an error message using the global logger
func Info ¶
func Info(format string, args ...interface{})
Info logs an informational message using the global logger
func InitWithConsole ¶
InitWithConsole initializes the global logger with optional console output
func NewSlogHandler ¶
NewSlogHandler returns a slog.Handler that forwards records to the provided Logger. If logger is nil, it returns nil.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides structured logging capabilities
func NewWithConsole ¶
func NewWithConsole(level Level, logPath string, prefix string, enableConsole bool) (*Logger, error)
NewWithConsole creates a new Logger instance with optional console output
func (*Logger) WithPrefix ¶
WithPrefix creates a new logger with an additional prefix
Click to show internal directories.
Click to hide internal directories.