Documentation ¶
Index ¶
- func Formatters() []string
- func Hooks() []string
- func Logger(loggerName ...string) (logger *logrus.Logger)
- func NewFormatter(name string, options Options) (formatter logrus.Formatter, err error)
- func NewHook(name string, options Options) (hook logrus.Hook, err error)
- func NewJSONFormatter(options Options) (formatter logrus.Formatter, err error)
- func NewLogger(name string, conf LoggerConfig) (logger *logrus.Logger, err error)
- func NewNullFormatter(options Options) (formatter logrus.Formatter, err error)
- func NewNullWriter(options Options) (writer io.Writer, err error)
- func NewStderrWriter(options Options) (writer io.Writer, err error)
- func NewStdoutWriter(options Options) (writer io.Writer, err error)
- func NewTextFormatter(options Options) (formatter logrus.Formatter, err error)
- func NewWriter(name string, options Options) (writer io.Writer, err error)
- func RegisterFormatter(name string, newFormatterFunc NewFormatterFunc)
- func RegisterHook(name string, newHookFunc NewHookFunc)
- func RegisterWriter(name string, newWriterFunc NewWriterFunc)
- func Writers() []string
- type Environments
- type FormatterConfig
- type HookConfig
- type JSONFormatterConfig
- type LoggerConfig
- type LoggerItem
- type LogrusMate
- type LogrusMateConfig
- type NewFormatterFunc
- type NewHookFunc
- type NewWriterFunc
- type NullFormatter
- type NullWriter
- type Options
- type TextFormatterConfig
- type WriterConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Formatters ¶
func Formatters() []string
func NewFormatter ¶
func NewJSONFormatter ¶
func NewNullFormatter ¶
func NewTextFormatter ¶
func RegisterFormatter ¶
func RegisterFormatter(name string, newFormatterFunc NewFormatterFunc)
func RegisterHook ¶
func RegisterHook(name string, newHookFunc NewHookFunc)
func RegisterWriter ¶
func RegisterWriter(name string, newWriterFunc NewWriterFunc)
Types ¶
type Environments ¶
type Environments struct {
RunEnv string `json:"run_env"`
}
type FormatterConfig ¶
type HookConfig ¶
type JSONFormatterConfig ¶
type JSONFormatterConfig struct {
TimestampFormat string `json:"timestamp_format"`
}
type LoggerConfig ¶
type LoggerConfig struct { Out WriterConfig `json:"out"` Level string `json:"level"` Hooks []HookConfig `json:"hooks"` Formatter FormatterConfig `json:"formatter"` }
func (*LoggerConfig) Validate ¶
func (conf *LoggerConfig) Validate(env ...string) (err error)
type LoggerItem ¶
type LoggerItem struct { Name string `json:"name"` Config map[string]LoggerConfig `json:"config"` }
type LogrusMate ¶
type LogrusMate struct {
// contains filtered or unexported fields
}
func NewLogrusMate ¶
func NewLogrusMate(mateConf LogrusMateConfig) (logrusMate *LogrusMate, err error)
func (*LogrusMate) Logger ¶
func (p *LogrusMate) Logger(loggerName ...string) (logger *logrus.Logger)
func (LogrusMate) NewLogger ¶
func (p LogrusMate) NewLogger(name string, conf LoggerConfig) (logger *logrus.Logger, err error)
type LogrusMateConfig ¶
type LogrusMateConfig struct { EnvironmentKeys Environments `json:"env_keys"` Loggers []LoggerItem `json:"loggers"` }
func LoadLogrusMateConfig ¶
func LoadLogrusMateConfig(filename string) (conf LogrusMateConfig, err error)
func (*LogrusMateConfig) RunEnv ¶
func (p *LogrusMateConfig) RunEnv() string
func (*LogrusMateConfig) Serialize ¶
func (p *LogrusMateConfig) Serialize() (data []byte, err error)
func (*LogrusMateConfig) Validate ¶
func (p *LogrusMateConfig) Validate() (err error)
type NullFormatter ¶
type NullFormatter struct { }
type NullWriter ¶
type NullWriter struct { }
type TextFormatterConfig ¶
type TextFormatterConfig struct { ForceColors bool `json:"force_colors"` DisableColors bool `json:"disable_colors"` DisableTimestamp bool `json:"disable_timestamp"` FullTimestamp bool `json:"full_timestamp"` TimestampFormat string `json:"timestamp_format"` DisableSorting bool `json:"disable_sorting"` }
type WriterConfig ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.