Documentation ¶
Overview ¶
Package zap implements github.com/magma/magma/src/go/log via github.com/uber-go/zap
Basic usage:
import ( uber_zap "go.uber.org/zap" "github.com/magma/magma/src/go/log" "github.com/magma/magma/src/go/log/zap" ) lm := log.NewManager(zap.NewLogger()) lm.LoggerFor("thing").Info().Print("hello") // Output: [thing] hello
Index ¶
- type Logger
- func (l *Logger) Debug() log.Printer
- func (l *Logger) Error() log.Printer
- func (l *Logger) Info() log.Printer
- func (l *Logger) Level() log.Level
- func (l *Logger) Named(name string) log.Logger
- func (l *Logger) SetLevel(level log.Level)
- func (l *Logger) Warning() log.Printer
- func (l *Logger) With(field string, value interface{}) log.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
Logger adapts *zap.Logger to github.com/magma/magma/src/go/log.Logger.
func New ¶
New returns a new *Logger, which satisfies magma/log.Logger. This function is available for fine-tuning logging config. For most usages, see NewLogger and NewLoggerAtLevel.
func NewLogger ¶
NewLogger returns a new root *Logger with default config, outputting to the specified paths. See uber_go/zap.Open docs for more info on supported path formats.
func NewLoggerAtLevel ¶
NewLoggerAtLevel creates a new *Logger at a specified log.Level with default console encoding outputting to the specified paths. See uber_go/zap.Open docs for more info on supported path formats.