Documentation
¶
Index ¶
- Constants
- type DefaultLogger
- func (l *DefaultLogger) DEBUG(msg string, args ...interface{})
- func (l *DefaultLogger) ERROR(msg string, args ...interface{})
- func (l *DefaultLogger) FATAL(msg string, args ...interface{})
- func (l *DefaultLogger) INFO(msg string, args ...interface{})
- func (l *DefaultLogger) WARNING(msg string, args ...interface{})
- type Formatter
Constants ¶
View Source
const ( Red = "\033[0;31m" Blue = "\033[0;34m" Green = "\033[0;32m" Yellow = "\033[0;33m" Purple = "\033[0;35m" NC = "\033[0m" // No Color )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
Level string
Message string
Args []interface{}
Formatter *Formatter
ColorEnabled bool // Controls color output
DebugEnabled bool // Controls debug log visibility
InfoEnabled bool // Controls info log visibility
WarningEnabled bool // Controls warning log visibility
ErrorEnabled bool // Controls error log visibility
FatalEnabled bool // Controls fatal log visibility
}
DefaultLogger now includes a map for custom log level colors.
func DefaultLogs ¶
func DefaultLogs() *DefaultLogger
DefaultLogs returns a new DefaultLogger instance with default configuration.
func (*DefaultLogger) DEBUG ¶
func (l *DefaultLogger) DEBUG(msg string, args ...interface{})
func (*DefaultLogger) ERROR ¶
func (l *DefaultLogger) ERROR(msg string, args ...interface{})
func (*DefaultLogger) FATAL ¶
func (l *DefaultLogger) FATAL(msg string, args ...interface{})
func (*DefaultLogger) INFO ¶
func (l *DefaultLogger) INFO(msg string, args ...interface{})
func (*DefaultLogger) WARNING ¶
func (l *DefaultLogger) WARNING(msg string, args ...interface{})
type Formatter ¶
type Formatter struct {
LogHolder string
Message string
Args []interface{}
Color string // Added to hold the color for the holder
}
Formatter represents the log message formatter including the color.
Click to show internal directories.
Click to hide internal directories.