-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Would you be open to moving wrappers to separate packages in this module?
Currently, when importing rockbears/log, log, zap and logrus are built in the binary even if the caller never uses those. Furthermore, since we generally only use one logging lib in our app, there are always two that aren't used. The worst scenario would be for a user to wrap the standard library: they'll get zap and logrus for free.
A modular approach would probably allow for the same functionality while keeping dependency lists clean.
Since the Go toolchain builds entire packages into the final binary, excluding ones that aren't used, splitting the wrappers in separate packages in this module would keep them nearby while not forcing them on users.
It would also allow adding other logging wrappers without bloating end-user binaries.
It would be a breaking change in several ways:
- wrappers structs, functions and methods would be moved to different packages
- the global
Factoryneeds to be either defined by the user or we need to find a way to not import logrus while still defining it:Line 22 in fd3fe4c
var Factory WrapperFactoryFunc = NewLogrusWrapper(logrus.StandardLogger())