Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // L is an alias for the standard logger. L = logrus.NewEntry(NewLogger()) )
Functions ¶
func FromContext ¶
FromContext gets logger from context. In case of no logger in context, the default logger is returned.
Types ¶
type EasyFormatter ¶
type EasyFormatter struct{}
func (*EasyFormatter) Format ¶
func (f *EasyFormatter) Format(entry *logrus.Entry) ([]byte, error)
The Formatter interface is used to implement a custom Formatter. It takes an `Entry`. It exposes all the fields, including the default ones:
* `entry.Data["msg"]`. The message passed from Info, Warn, Error .. * `entry.Data["time"]`. The timestamp. * `entry.Data["level"]. The level the entry was logged at.
Any additional fields added with `WithField` or `WithFields` are also in `entry.Data`. Format is expected to return an array of bytes which are then logged to `logger.Out`.
Click to show internal directories.
Click to hide internal directories.