Documentation ¶
Index ¶
- Constants
- func RFC3339Formatter(key string) zap.TimeFormatter
- func UnixEpochFormatter(key string) zap.TimeFormatter
- type LagerAdapter
- func (l *LagerAdapter) Debug(action string, data ...lager.Data)
- func (l *LagerAdapter) Error(action string, err error, data ...lager.Data)
- func (l *LagerAdapter) Fatal(action string, err error, data ...lager.Data)
- func (l *LagerAdapter) Info(action string, data ...lager.Data)
- func (l *LagerAdapter) RegisterSink(_ lager.Sink)
- func (l *LagerAdapter) Session(task string, data ...lager.Data) lager.Logger
- func (l *LagerAdapter) SessionName() string
- func (l *LagerAdapter) WithData(data lager.Data) lager.Logger
- func (l *LagerAdapter) WithTraceInfo(req *http.Request) lager.Logger
- type Logger
Constants ¶
View Source
const (
RequestIdHeader = "X-Vcap-Request-Id"
)
Variables ¶
This section is empty.
Functions ¶
func RFC3339Formatter ¶
func RFC3339Formatter(key string) zap.TimeFormatter
func UnixEpochFormatter ¶
func UnixEpochFormatter(key string) zap.TimeFormatter
Types ¶
type LagerAdapter ¶
type LagerAdapter struct {
// contains filtered or unexported fields
}
LagerAdapter satisfies the lager.Logger interface with zap as the implementation.
func NewLagerAdapter ¶
func NewLagerAdapter(zapLogger Logger) *LagerAdapter
NewLagerAdapter returns a new lager.Logger that uses zap underneath.
func (*LagerAdapter) Debug ¶
func (l *LagerAdapter) Debug(action string, data ...lager.Data)
Debug logs a message at the debug log level.
func (*LagerAdapter) Error ¶
func (l *LagerAdapter) Error(action string, err error, data ...lager.Data)
Error logs a message at the error log level.
func (*LagerAdapter) Fatal ¶
func (l *LagerAdapter) Fatal(action string, err error, data ...lager.Data)
Fatal logs a message and exits with status 1.
func (*LagerAdapter) Info ¶
func (l *LagerAdapter) Info(action string, data ...lager.Data)
Info logs a message at the info log level.
func (*LagerAdapter) RegisterSink ¶
func (l *LagerAdapter) RegisterSink(_ lager.Sink)
RegisterSink is never used after initialization, so it does nothing.
func (*LagerAdapter) Session ¶
func (l *LagerAdapter) Session(task string, data ...lager.Data) lager.Logger
Session returns a new logger with a nested session.
func (*LagerAdapter) SessionName ¶
func (l *LagerAdapter) SessionName() string
SessionName returns the name of the logger session
func (*LagerAdapter) WithData ¶
func (l *LagerAdapter) WithData(data lager.Data) lager.Logger
WithData returns a logger with newly added data.
func (*LagerAdapter) WithTraceInfo ¶
func (l *LagerAdapter) WithTraceInfo(req *http.Request) lager.Logger
type Logger ¶
type Logger interface { With(...zap.Field) Logger Check(zap.Level, string) *zap.CheckedMessage Log(zap.Level, string, ...zap.Field) Debug(string, ...zap.Field) Info(string, ...zap.Field) Warn(string, ...zap.Field) Error(string, ...zap.Field) DPanic(string, ...zap.Field) Panic(string, ...zap.Field) Fatal(string, ...zap.Field) Session(string) Logger SessionName() string }
Logger is the zap.Logger interface with additional Session methods.
Click to show internal directories.
Click to hide internal directories.