Documentation ¶
Overview ¶
Package logger provides a tetratelabs/telemetry Logger implementation based on Go kit log.
Index ¶
- Constants
- type Logger
- func (l *Logger) Context(ctx context.Context) telemetry.Logger
- func (l *Logger) Debug(msg string, keyValues ...interface{})
- func (l *Logger) Error(msg string, err error, keyValues ...interface{})
- func (l *Logger) Info(msg string, keyValues ...interface{})
- func (l *Logger) Level() level.Value
- func (l *Logger) Metric(m telemetry.Metric) telemetry.Logger
- func (l *Logger) New() telemetry.Logger
- func (l *Logger) SetLevel(lvl level.Value)
- func (l *Logger) UnwrapLogger() log.Logger
- func (l *Logger) With(keyValues ...interface{}) telemetry.Logger
Constants ¶
Available log levels.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger implements the telemetry.Logger interface using Go kit Log.
func NewSyncLogfmt ¶ added in v0.2.0
NewSyncLogfmt returns a new telemetry.Logger implementation using Go kit's sync writer and logfmt output format.
func (*Logger) Context ¶
Context attaches provided Context to the Logger allowing metadata found in this context to be used for log lines and metrics labels.
func (*Logger) Error ¶
Error logging with key-value pairs. Use this when application state and stability are at risk. These types of conditions are actionable and often alerted on. It is very strongly encouraged to add a Metric to each of these types of messages. Metrics provide the easiest way to coordinate processing of these concerns and triggering alerting systems through your metrics backend.
func (*Logger) Info ¶
Info logging with key-value pairs. This is for informational, but not directly actionable conditions. It is highly recommended you attach a Metric to these types of messages. Where a single informational or warning style message might not be reason for action, a change in occurrence does warrant action. By attaching a Metric for these logging situations, you make this easy through histograms, thresholds, etc.
func (*Logger) Metric ¶
Metric attaches provided Metric to the Logger allowing this metric to record each invocation of Info and Error log lines. If context is available in the logger, it can be used for Metrics labels.
func (*Logger) New ¶ added in v0.4.0
New returns a new Logger based on the original implementation but with the log level decoupled.
func (*Logger) SetLevel ¶
SetLevel provides the ability to set the desired logging level. This function can be used at runtime and is safe for concurrent use.
func (*Logger) UnwrapLogger ¶ added in v0.3.0
UnwrapLogger returns the wrapped original logger implementation used by this Logging bridge.