😄 zap logger configurations
import (
"go.uber.org/zap/zapcore"
"moul.io/zapconfig"
)
func Example() {
logger := zapconfig.Configurator{}.MustBuild()
logger.Info("hello!")
}
func Example_configuration() {
logger := zapconfig.New().
EnableStacktrace().
SetLevel(zapcore.DebugLevel).
SetOutputPath("stderr").
SetOutputPaths([]string{"stderr", "stdout", "./path/to/log.txt"}).
SetPreset("light-console").
MustBuild()
logger.Info("hello!")
}
$ go get moul.io/zapconfig
See https://github.com/moul/zapconfig/releases
I really welcome contributions. Your input is the most precious material. I'm well aware of that and I thank you in advance. Everyone is encouraged to look at what they can do on their own scale; no effort is too small.
Everything on contribution is sum up here: CONTRIBUTING.md
Thanks goes to these wonderful people (emoji key):
Manfred Touron 🚧 📖 |
moul-bot 🚧 |
This project follows the all-contributors specification. Contributions of any kind welcome!
© 2020 Manfred Touron
Licensed under the Apache License, Version 2.0 (LICENSE-APACHE
) or the MIT license (LICENSE-MIT
), at your option. See the COPYRIGHT
file for more details.
SPDX-License-Identifier: (Apache-2.0 OR MIT)