Documentation ¶
Index ¶
- Variables
- func Formatters() []string
- func Hijack(logger *logrus.Logger, opts ...Option) (err error)
- func Hooks() []string
- func NewFormatter(name string, config config.Configuration) (formatter logrus.Formatter, err error)
- func NewHook(name string, config config.Configuration) (hook logrus.Hook, err error)
- func NewJSONFormatter(config config.Configuration) (formatter logrus.Formatter, err error)
- func NewLogger(opts ...Option) (logger *logrus.Logger, err error)
- func NewNullFormatter(config config.Configuration) (formatter logrus.Formatter, err error)
- func NewNullWriter(conf config.Configuration) (writer io.Writer, err error)
- func NewStderrWriter(config.Configuration) (writer io.Writer, err error)
- func NewStdoutWriter(config.Configuration) (writer io.Writer, err error)
- func NewTextFormatter(config config.Configuration) (formatter logrus.Formatter, err error)
- func NewWriter(name string, conf config.Configuration) (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 Config
- type JSONFormatterConfig
- type LogrusMate
- type NewFormatterFunc
- type NewHookFunc
- type NewWriterFunc
- type NullFormatter
- type NullWriter
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrLoggerNotExist = errors.New("logger not exist")
)
Functions ¶
func Formatters ¶
func Formatters() []string
func NewFormatter ¶
func NewJSONFormatter ¶
func NewJSONFormatter(config config.Configuration) (formatter logrus.Formatter, err error)
func NewNullFormatter ¶
func NewNullFormatter(config config.Configuration) (formatter logrus.Formatter, err error)
func NewNullWriter ¶
func NewNullWriter(conf config.Configuration) (writer io.Writer, err error)
func NewStderrWriter ¶
func NewStderrWriter(config.Configuration) (writer io.Writer, err error)
func NewStdoutWriter ¶
func NewStdoutWriter(config.Configuration) (writer io.Writer, err error)
func NewTextFormatter ¶
func NewTextFormatter(config config.Configuration) (formatter logrus.Formatter, err error)
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 JSONFormatterConfig ¶
type JSONFormatterConfig struct {
TimestampFormat string `json:"timestamp_format"`
}
type LogrusMate ¶
type LogrusMate struct {
// contains filtered or unexported fields
}
func NewLogrusMate ¶
func NewLogrusMate(opts ...Option) (logrusMate *LogrusMate, err error)
type NewFormatterFunc ¶
type NewFormatterFunc func(config.Configuration) (formatter logrus.Formatter, err error)
type NewHookFunc ¶
type NewHookFunc func(config.Configuration) (hook logrus.Hook, err error)
type NewWriterFunc ¶
type NewWriterFunc func(config.Configuration) (writer io.Writer, err error)
type NullFormatter ¶
type NullFormatter struct { }
type NullWriter ¶
type NullWriter struct { }
type Option ¶
type Option func(*Config)
func ConfigFile ¶
func ConfigProvider ¶
func ConfigProvider(provider config.ConfigurationProvider) Option
func ConfigString ¶
func WithConfig ¶
func WithConfig(conf config.Configuration) Option
Source Files ¶
Click to show internal directories.
Click to hide internal directories.