Documentation ¶
Index ¶
- Variables
- type Configuration
- type Logger
- func (l *Logger) Debug(data ...interface{})
- func (l *Logger) Error(data ...interface{})
- func (l *Logger) Fatal(data ...interface{})
- func (l *Logger) GetLeafName() string
- func (l *Logger) Info(data ...interface{})
- func (l *Logger) LevelEnabled(level *level) bool
- func (l *Logger) PostConstruct()
- func (l *Logger) Trace(data ...interface{})
- func (l *Logger) Warn(data ...interface{})
- type Logpher
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Trace = &level{0, traceString, color.WhiteString} Debug = &level{1, debugString, color.BlueString} Info = &level{2, infoString, color.CyanString} Warn = &level{3, warnString, color.YellowString} Error = &level{4, errString, color.RedString} Fatal = &level{5, fatalString, color.HiRedString} Off = &level{6, offString, nil} )
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Type string // The main writer type Combine string // A comma separated string indicating which loggers to combine when using a combination writer File string // The file path for file-based writers Size int // The maximum size in bytes for the rolling writer Count int // The maximum file count for the rolling writer Levels map[string]string // contains filtered or unexported fields }
Configuration defines the configuration structure for logging
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration creates a new configuration object
type Logger ¶
type Logger struct { Logpher *Logpher `autumn:"logpher"` // contains filtered or unexported fields }
Logger defines a logger structure
func (*Logger) GetLeafName ¶
GetLeafName gets the autumn leaf name
func (*Logger) LevelEnabled ¶
LevelEnabled determines if logs at the specified level will be written by this logger
func (*Logger) PostConstruct ¶
func (l *Logger) PostConstruct()
PostConstruct initializes the logger when it's used as an autumn leaf
type Logpher ¶
type Logpher struct {
Configuration *Configuration `autumn:"logConfiguration"`
}
Logpher defines the main logging structure
func New ¶
func New(configuration *Configuration) *Logpher
New creates a new logpher instance with the supplied configuration
func (*Logpher) GetLeafName ¶
GetLeafName gets the autumn leaf name
func (*Logpher) PostConstruct ¶
func (l *Logpher) PostConstruct()
PostConstruct enables autumn post construct functionality
func (*Logpher) PreDestroy ¶
func (l *Logpher) PreDestroy()
PreDestroy enables autumn pre destroy functionality
Click to show internal directories.
Click to hide internal directories.