Documentation ¶
Overview ¶
Package golog provides a common logging interface and configuration shape that wraps previously existing logger frameworks
Index ¶
Constants ¶
View Source
const ( // ModuleName uniquely identifies the name of this package // When used with config.Config, ModuleName should be the key provided to config.Config#Get ModuleName = `logger` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Kind refers to the type of supported logger: i.e., `noop`, `zerolog` Kind string `mapstructure:"kind"` // Level is desired the logging level Level string `mapstructure:"level"` // Outputs are filesystem paths to which logs should be written to. Also accepts `stdout` and `stderr`. Outputs []string `mapstructure:"outputs"` // Metadata are key-value pairs that are included on every log Metadata map[string]interface{} `mapstructure:"metadata"` }
Config provides the possible options to customize the Interface instance
type Interface ¶
type Interface interface { NewWithFields(kv ...interface{}) Interface Debug(msg string) Debugf(format string, args ...interface{}) Info(msg string) Infof(format string, args ...interface{}) Warn(msg string) Warnf(format string, args ...interface{}) Error(msg string) Errorf(format string, args ...interface{}) Fatal(msg string) Fatalf(format string, args ...interface{}) }
Interface provides a common logger interface agnostic of the underlying implementation
func NewLoggerFromConfig ¶
Click to show internal directories.
Click to hide internal directories.