Documentation ¶
Index ¶
- type Level
- 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) Metric(m telemetry.Metric) telemetry.Logger
- func (l *Logger) SetLevel(lvl Level)
- func (l *Logger) With(keyValues ...interface{}) telemetry.Logger
- type ScopeManager
- func (s *ScopeManager) Deregister(name string) bool
- func (s *ScopeManager) FlagSet() *run.FlagSet
- func (s *ScopeManager) GetDefaultOutputLevel() Level
- func (s *ScopeManager) GetOutputLevel(name string) (Level, error)
- func (s *ScopeManager) Name() string
- func (s *ScopeManager) PrintRegisteredScopes()
- func (s *ScopeManager) Register(name, description string) *Logger
- func (s *ScopeManager) SetDefaultOutputLevel(lvl Level)
- func (s *ScopeManager) SetScopeOutputLevel(name string, lvl Level) error
- func (s *ScopeManager) Validate() error
Constants ¶
This section is empty.
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.
type ScopeManager ¶ added in v0.2.0
type ScopeManager struct {
// contains filtered or unexported fields
}
ScopeManager manages scoped loggers.
func NewScopeManager ¶ added in v0.2.0
func NewScopeManager(logger *Logger) *ScopeManager
NewScopeManager returns a new Scope Manager for Logger.
func (*ScopeManager) Deregister ¶ added in v0.2.0
func (s *ScopeManager) Deregister(name string) bool
Deregister will attempt to deregister a scoped Logger identified by the provided name. If the logger was found, the function returns true.
func (*ScopeManager) FlagSet ¶ added in v0.2.0
func (s *ScopeManager) FlagSet() *run.FlagSet
FlagSet implements run.Config.
func (*ScopeManager) GetDefaultOutputLevel ¶ added in v0.2.0
func (s *ScopeManager) GetDefaultOutputLevel() Level
GetDefaultOutputLevel returns the default minimum output level for scopes.
func (*ScopeManager) GetOutputLevel ¶ added in v0.2.0
func (s *ScopeManager) GetOutputLevel(name string) (Level, error)
GetOutputLevel returns the minimum log output level for a given scope.
func (*ScopeManager) Name ¶ added in v0.2.0
func (s *ScopeManager) Name() string
Name implements run.Unit.
func (*ScopeManager) PrintRegisteredScopes ¶ added in v0.2.0
func (s *ScopeManager) PrintRegisteredScopes()
PrintRegisteredScopes logs all the registered scopes and their configured output levels.
func (*ScopeManager) Register ¶ added in v0.2.0
func (s *ScopeManager) Register(name, description string) *Logger
Register takes a name and description and returns a scoped Logger.
func (*ScopeManager) SetDefaultOutputLevel ¶ added in v0.2.0
func (s *ScopeManager) SetDefaultOutputLevel(lvl Level)
SetDefaultOutputLevel sets the minimum log output level for all scopes.
func (*ScopeManager) SetScopeOutputLevel ¶ added in v0.2.0
func (s *ScopeManager) SetScopeOutputLevel(name string, lvl Level) error
SetScopeOutputLevel sets the minimum log output level for a given scope.
func (*ScopeManager) Validate ¶ added in v0.2.0
func (s *ScopeManager) Validate() error
Validate implements run.Config.