Documentation ¶
Index ¶
- Variables
- func InitLogger(cfg *server.Config)
- func LevelFilter(l string) level.Option
- func WarnExperimentalUse(feature string)
- func WithContext(ctx context.Context, l kitlog.Logger) kitlog.Logger
- func WithSourceIPs(sourceIPs string, l kitlog.Logger) kitlog.Logger
- func WithTraceID(traceID string, l kitlog.Logger) kitlog.Logger
- func WithUserID(userID string, l kitlog.Logger) kitlog.Logger
- type RateLimitedLogger
Constants ¶
This section is empty.
Variables ¶
var Logger = kitlog.NewNopLogger()
Logger is a shared go-kit logger. TODO: Change all components to take a non-global logger via their constructors. Prefer accepting a non-global logger as an argument.
Functions ¶
func InitLogger ¶
InitLogger initialises the global gokit logger and overrides the default logger for the server.
func LevelFilter ¶
TODO: remove once weaveworks/common updates to go-kit/log -> we can then revert to using Level.Gokit
func WarnExperimentalUse ¶
func WarnExperimentalUse(feature string)
WarnExperimentalUse logs a warning and increments the experimental features metric.
func WithContext ¶
WithContext returns a Logger that has information about the current user in its details.
e.g. log := util.WithContext(ctx) log.Errorf("Could not chunk chunks: %v", err)
func WithSourceIPs ¶
WithSourceIPs returns a Logger that has information about the source IPs in its details.
func WithTraceID ¶
WithTraceID returns a Logger that has information about the traceID in its details.
Types ¶
type RateLimitedLogger ¶
type RateLimitedLogger struct {
// contains filtered or unexported fields
}
func NewRateLimitedLogger ¶
func NewRateLimitedLogger(logsPerSecond int, logger gkLog.Logger) *RateLimitedLogger
func (*RateLimitedLogger) Log ¶
func (l *RateLimitedLogger) Log(keyvals ...interface{})