Documentation ¶
Index ¶
- Constants
- Variables
- func GetDateByFormat(format string) string
- func GetLevelValueByName(n string) uint
- type Appender
- type AppenderConfig
- type AppendersConfig
- type CategoriesConfig
- type CategoryConfig
- type Color
- type ILogger
- type Layout
- type LayoutConfig
- type LayoutTokens
- type Level
- type LoggerConfig
- type LoggingEvent
Constants ¶
View Source
const ( LocaleTime = "15:04:05" ISO8601 = "2006-01-02T15:04:05.000" Iso8601WithTzOffset = "2006-01-02T15:04:05.000-07:00" AbsoluteTime = "15:04:05.000" Datetime = "2006/01/02-15:04:05" )
View Source
const ( All = "ALL" Trace = "TRACE" Debug = "DEBUG" Info = "INFO" Error = "ERROR" Warn = "WARN" Fatal = "FATAL" Off = "OFF" )
Variables ¶
View Source
var ( ColorReset = &Color{"reset", "\033[0m"} ColorRed = &Color{"red", "\033[31m"} ColorGreen = &Color{"green", "\033[32m"} ColorYellow = &Color{"yellow", "\033[33m"} ColorBlue = &Color{"Blue", "\033[34m"} ColorMagenta = &Color{"magenta", "\033[35m"} ColorCyan = &Color{"cyan", "\033[36m"} )
View Source
var ( LevelTrace = &Level{5000, Trace, *ColorBlue, 0} LevelDebug = &Level{10000, Debug, *ColorCyan, 1} LevelInfo = &Level{20000, Info, *ColorGreen, 2} LevelWarn = &Level{30000, Warn, *ColorYellow, 3} LevelError = &Level{40000, Error, *ColorRed, 4} LevelFatal = &Level{50000, Fatal, *ColorMagenta, 5} )
Functions ¶
func GetDateByFormat ¶
func GetLevelValueByName ¶
Types ¶
type Appender ¶
type Appender func(LoggingEvent)
type AppenderConfig ¶
func (AppenderConfig) GetChannelSize ¶
func (c AppenderConfig) GetChannelSize() int
func (AppenderConfig) GetInternalChannelSize ¶
func (c AppenderConfig) GetInternalChannelSize() int
func (AppenderConfig) GetLayout ¶
func (c AppenderConfig) GetLayout() LayoutConfig
func (AppenderConfig) GetType ¶
func (c AppenderConfig) GetType() string
type AppendersConfig ¶
type AppendersConfig map[string]AppenderConfig
type CategoriesConfig ¶
type CategoriesConfig map[string]CategoryConfig
type CategoryConfig ¶
func (CategoryConfig) GetAssociatedAppenders ¶
func (c CategoryConfig) GetAssociatedAppenders() []string
func (CategoryConfig) GetLevelValue ¶
func (c CategoryConfig) GetLevelValue() uint
func (CategoryConfig) GetName ¶
func (c CategoryConfig) GetName() string
func (CategoryConfig) SetName ¶
func (c CategoryConfig) SetName(n string)
type ILogger ¶
type ILogger interface { AddContext(key string, value any) ChangeOneContext(key string, value any) ChangeManyContext(c map[string]any) RemoveContext(key string) ClearContext() Trace(args ...any) Debug(args ...any) Info(args ...any) Warn(args ...any) Error(args ...any) Fatal(args ...any) Terminate() }
type Layout ¶
type Layout func(LoggingEvent) string
type LayoutConfig ¶
func (LayoutConfig) GetType ¶
func (c LayoutConfig) GetType() string
type LayoutTokens ¶
type Level ¶
func GetLevelByName ¶
type LoggerConfig ¶
func (LoggerConfig) GetAppenders ¶
func (lc LoggerConfig) GetAppenders() AppendersConfig
func (LoggerConfig) GetCategories ¶
func (lc LoggerConfig) GetCategories() CategoriesConfig
Click to show internal directories.
Click to hide internal directories.