Documentation ¶
Index ¶
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(log string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Flush()
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) WithContext(ctx context.Context) flamingo.Logger
- func (l *Logger) WithCorrelationID(cid string) flamingo.Logger
- func (l *Logger) WithField(key flamingo.LogKey, value interface{}) flamingo.Logger
- func (l *Logger) WithFields(fields map[flamingo.LogKey]interface{}) flamingo.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
Logger is a Wrapper for the zap logger fulfilling the flamingo.Logger interface
func (*Logger) Debug ¶
func (l *Logger) Debug(args ...interface{})
Debug logs a message at debug level
func (*Logger) Error ¶
func (l *Logger) Error(args ...interface{})
Error logs a message at error level
func (*Logger) Fatal ¶
func (l *Logger) Fatal(args ...interface{})
Fatal logs a message at fatal level The logger then calls os.Exit(1), even if logging at FatalLevel is disabled.
func (*Logger) Flush ¶
func (l *Logger) Flush()
Flush is used by buffered loggers and triggers the actual writing. It is a good habit to call Flush before letting the process exit. For the top level flamingo.Logger, this is called by the app itself.
func (*Logger) Panic ¶
func (l *Logger) Panic(args ...interface{})
Panic logs a message at panic level The logger then panics, even if logging at PanicLevel is disabled.
func (*Logger) WithContext ¶
WithContext returns a logger with fields filled from the context businessId: From Header X-Business-ID client_ip: From Header X-Forwarded-For or request if header is empty correlationId: The ID of the context method: HTTP verb from request path: URL path from request referer: referer from request request: received payload from request
func (*Logger) WithCorrelationID ¶
WithCorrelationID returns a logger with a correlation ID field