The main reason is gommon/log does NOT have package level methods to log with default config.
So most time in pkg.go I have the following code
import (
dlog "github.com/dyweb/gommon/log"
)
var logReg = dlog.NewRegistry()
var log = logReg.Logger()
To avoid the rename during import, we can just rename the package because log is used more often, while the logger of gommon/log is a drop in replacement for many logging libraries, the library itself is not. This is also why we use errors instead of derrors. The d prefix from dyweb
It will break all the application/dependencies that depend on it, but AFIK there is no third party library or application using gommon/log
The main reason is gommon/log does NOT have package level methods to log with default config.
So most time in
pkg.goI have the following codeTo avoid the rename during import, we can just rename the package because
logis used more often, while the logger of gommon/log is a drop in replacement for many logging libraries, the library itself is not. This is also why we useerrorsinstead ofderrors. Thedprefix fromdywebIt will break all the application/dependencies that depend on it, but AFIK there is no third party library or application using gommon/log