Golang global logging using uber zap
so you want to use the logger from go.uber.org/zap globally, and there are several ways of doing it: (for shortest way jump to #4)
1. pass-it-down
(just too many to pass it down and you know how)
2. Injection
func main() {
logger, _ := zap.NewProduction()
otherPackage1.Logger = logger
otherPackage2.Logger = logger
.... // tedious >_<
}// other package
package otherPackage1var Logger *zap.Logger
...
func…