Documentation ¶
Overview ¶
Package log provides the logging facilities used for horizon.
You may notice that this package does not expose the "Fatal" family of logging functions: this is intentional. This package is specifically geared to logging within the context of an http server, and our chosen path for responding to "Oh my god something is horribly wrong" within the context of an HTTP request is to panic on that request.
Index ¶
- Constants
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func New() (result *Entry, m *Metrics)
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func PushContext(parent context.Context, modFn func(*Entry) *Entry) context.Context
- func Set(parent context.Context, logger *Entry) context.Context
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type Entry
- func (e *Entry) Debug(args ...interface{})
- func (e *Entry) Debugf(format string, args ...interface{})
- func (e *Entry) Error(args ...interface{})
- func (e *Entry) Errorf(format string, args ...interface{})
- func (e *Entry) Info(args ...interface{})
- func (e *Entry) Infof(format string, args ...interface{})
- func (e *Entry) Panic(args ...interface{})
- func (e *Entry) Panicf(format string, args ...interface{})
- func (e *Entry) Warn(args ...interface{})
- func (e *Entry) Warnf(format string, args ...interface{})
- func (e *Entry) WithField(key string, value interface{}) *Entry
- func (e *Entry) WithFields(fields F) *Entry
- func (e *Entry) WithStack(err error) *Entry
- type F
- type LogglyHook
- type Metrics
Constants ¶
const ( PanicLevel = logrus.PanicLevel ErrorLevel = logrus.ErrorLevel WarnLevel = logrus.WarnLevel InfoLevel = logrus.InfoLevel DebugLevel = logrus.DebugLevel )
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf logs a message at the debug severity.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf logs a message at the Error severity.
func Infof ¶
func Infof(format string, args ...interface{})
Infof logs a message at the Info severity.
func Panicf ¶
func Panicf(format string, args ...interface{})
Panicf logs a message at the Panic severity.
func PushContext ¶
PushContext is a helper method to derive a new context with a modified logger bound to it, where the logger is derived from the current value on the context.
Types ¶
type Entry ¶
var DefaultLogger *Entry
func Ctx ¶
C returns the logger bound to the provided context, otherwise providing the default logger.
func WithFields ¶
func (*Entry) Debug ¶
func (e *Entry) Debug(args ...interface{})
Debug logs a message at the debug severity.
func (*Entry) Error ¶
func (e *Entry) Error(args ...interface{})
Error logs a message at the Error severity.
func (*Entry) Info ¶
func (e *Entry) Info(args ...interface{})
Info logs a message at the Info severity.
func (*Entry) Panic ¶
func (e *Entry) Panic(args ...interface{})
Panic logs a message at the Panic severity.
func (*Entry) Warn ¶
func (e *Entry) Warn(args ...interface{})
Warn logs a message at the Warn severity.
func (*Entry) WithFields ¶
type LogglyHook ¶
LogglyHook sends logs to loggly
func (*LogglyHook) Flush ¶
func (hook *LogglyHook) Flush()
func (*LogglyHook) Levels ¶
func (hook *LogglyHook) Levels() []logrus.Level