logging

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterLevel

func FilterLevel(level zapcore.Level) func(zapcore.Core) zapcore.Core

FilterLevel wraps an existing zap.Core but logs at a different level. This function can be used to create child loggers which should print only log levels at a different log level than the parent logger.

func NewLogger

func NewLogger(cfg *Config, metricsNamespace string) *zap.Logger

NewLogger creates a preconfigured global logger and configures the global zap logger

Types

type Config

type Config struct {
	LogLevelInput string `yaml:"level"`
	LogLevel      zap.AtomicLevel
}

Config for a zap logger

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config the server

func (*Config) Set

func (cfg *Config) Set(logLevel string) error

Set updates the value of the allowed log level by implementing the flag.Value interface

func (*Config) SetDefaults added in v0.4.0

func (c *Config) SetDefaults()

func (*Config) String

func (cfg *Config) String() string

String implements the flag.Value interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL