Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... PanicLevel = logrus.PanicLevel // FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the // logging level is set to Panic. FatalLevel = logrus.FatalLevel // ErrorLevel level. Logs. Used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel = logrus.ErrorLevel // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel = logrus.WarnLevel // InfoLevel level. General operational entries about what's going on inside the // application. InfoLevel = logrus.InfoLevel // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel = logrus.DebugLevel )
View Source
const Version = "v1.0.6"
Version of the logger
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldLogger ¶
type FieldLogger interface { Logger WithField(string, interface{}) FieldLogger WithFields(map[string]interface{}) FieldLogger }
FieldLogger interface
func New ¶
func New(lvl Level) FieldLogger
New based on the specified log level, defaults to "debug". This logger will log to the STDOUT in a human readable, but parseable form.
Example: time="2016-12-01T21:02:07-05:00" level=info duration=225.283µs human_size="106 B" method=GET path="/" render=199.79µs request_id=2265736089 size=106 status=200
func NewLogger ¶
func NewLogger(level string) FieldLogger
NewLogger based on the specified log level, defaults to "debug". See `New` for more details.
type Logger ¶
type Logger interface { Debugf(string, ...interface{}) Infof(string, ...interface{}) Printf(string, ...interface{}) Warnf(string, ...interface{}) Errorf(string, ...interface{}) Fatalf(string, ...interface{}) Debug(...interface{}) Info(...interface{}) Warn(...interface{}) Error(...interface{}) Fatal(...interface{}) Panic(...interface{}) }
Logger interface is used throughout Buffalo apps to log a whole manner of things.
type Logrus ¶
type Logrus struct {
logrus.FieldLogger
}
Logrus is a Logger implementation backed by sirupsen/logrus
func (Logrus) SetOutput ¶
SetOutput will try and set the output of the underlying logrus.FieldLogger if it can
func (Logrus) WithField ¶
func (l Logrus) WithField(s string, i interface{}) FieldLogger
WithField returns a new Logger with the field added
func (Logrus) WithFields ¶
func (l Logrus) WithFields(m map[string]interface{}) FieldLogger
WithFields returns a new Logger with the fields added
Click to show internal directories.
Click to hide internal directories.