Documentation
¶
Index ¶
- Constants
- type ColoredLogger
- func (l *ColoredLogger) ComponentDebug(component Component, msg string, fields ...zap.Field)
- func (l *ColoredLogger) ComponentError(component Component, msg string, fields ...zap.Field)
- func (l *ColoredLogger) ComponentInfo(component Component, msg string, fields ...zap.Field)
- func (l *ColoredLogger) ComponentWarn(component Component, msg string, fields ...zap.Field)
- type Component
- type StandardLogger
Constants ¶
View Source
const ( Reset = "\033[0m" Bold = "\033[1m" Dim = "\033[2m" // Standard colors Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" Gray = "\033[90m" // Bright colors BrightRed = "\033[91m" BrightGreen = "\033[92m" BrightYellow = "\033[93m" BrightBlue = "\033[94m" BrightMagenta = "\033[95m" BrightCyan = "\033[96m" BrightWhite = "\033[97m" )
ANSI color codes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColoredLogger ¶
ColoredLogger wraps zap.Logger with colored output
func NewColoredLogger ¶
func NewColoredLogger(component Component, enableColors bool) (*ColoredLogger, error)
NewColoredLogger creates a new colored logger
func NewDefaultLogger ¶
func NewDefaultLogger(component Component) (*ColoredLogger, error)
NewDefaultLogger creates a logger with default settings and color auto-detection
func (*ColoredLogger) ComponentDebug ¶
func (l *ColoredLogger) ComponentDebug(component Component, msg string, fields ...zap.Field)
func (*ColoredLogger) ComponentError ¶
func (l *ColoredLogger) ComponentError(component Component, msg string, fields ...zap.Field)
func (*ColoredLogger) ComponentInfo ¶
func (l *ColoredLogger) ComponentInfo(component Component, msg string, fields ...zap.Field)
Component-specific logging methods
func (*ColoredLogger) ComponentWarn ¶
func (l *ColoredLogger) ComponentWarn(component Component, msg string, fields ...zap.Field)
type Component ¶
type Component string
Component represents different parts of the system for color coding
const ( ComponentNode Component = "NODE" ComponentRQLite Component = "RQLITE" ComponentLibP2P Component = "LIBP2P" ComponentStorage Component = "STORAGE" ComponentDatabase Component = "DATABASE" ComponentClient Component = "CLIENT" ComponentGeneral Component = "GENERAL" ComponentAnyone Component = "ANYONE" )
type StandardLogger ¶
type StandardLogger struct {
// contains filtered or unexported fields
}
StandardLogger provides colored standard library compatible logging
func NewStandardLogger ¶
func NewStandardLogger(component Component) (*StandardLogger, error)
NewStandardLogger creates a standard library compatible colored logger
func (*StandardLogger) Errorf ¶
func (s *StandardLogger) Errorf(format string, v ...interface{})
func (*StandardLogger) Print ¶
func (s *StandardLogger) Print(v ...interface{})
Print implements the standard library log interface with colors
func (*StandardLogger) Printf ¶
func (s *StandardLogger) Printf(format string, v ...interface{})
Printf implements the standard library log interface with colors
func (*StandardLogger) Println ¶
func (s *StandardLogger) Println(v ...interface{})
Println implements the standard library log interface with colors
Click to show internal directories.
Click to hide internal directories.