Documentation
¶
Index ¶
- func ExtractComponentFromStreamName(streamName string) string
- func ExtractLogLevel(message string) string
- func ExtractLogTypeFromStreamName(streamName string) string
- func GetLogTypeDescription(availableLogTypes []string) string
- func NormalizeLogType(logType string) string
- func ParseTimeString(timeStr string) (*time.Time, error)
- func PrintLog(log LogEntry, messageOnly bool, colorConfig *ColorConfig)
- type ColorConfig
- type ColorMode
- type LogColorizer
- type LogEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractLogLevel ¶
func GetLogTypeDescription ¶
func NormalizeLogType ¶
func PrintLog ¶
func PrintLog(log LogEntry, messageOnly bool, colorConfig *ColorConfig)
Types ¶
type ColorConfig ¶ added in v0.1.6
type ColorConfig struct {
Mode ColorMode
}
ColorConfig holds the configuration for color output
func NewColorConfig ¶ added in v0.1.6
func NewColorConfig() *ColorConfig
NewColorConfig creates a new ColorConfig with default settings
func (*ColorConfig) ShouldUseColor ¶ added in v0.1.6
func (c *ColorConfig) ShouldUseColor() bool
ShouldUseColor determines whether colors should be used based on the configuration
type ColorMode ¶ added in v0.1.6
type ColorMode string
ColorMode defines how colors should be handled
type LogColorizer ¶ added in v0.1.6
type LogColorizer struct {
// contains filtered or unexported fields
}
LogColorizer provides rich color formatting for logs
func NewLogColorizer ¶ added in v0.1.6
func NewLogColorizer(config *ColorConfig) *LogColorizer
NewLogColorizer creates a new LogColorizer
func (*LogColorizer) ColorizeLog ¶ added in v0.1.6
func (lc *LogColorizer) ColorizeLog(entry LogEntry) string
ColorizeLog applies color formatting to a log entry based on its type and content
func (*LogColorizer) ColorizeMessageOnly ¶ added in v0.1.6
func (lc *LogColorizer) ColorizeMessageOnly(message string, logType string, level string) string
ColorizeMessageOnly applies color formatting to just the message part based on log type
Click to show internal directories.
Click to hide internal directories.