Package configuration
Override logging behavior for selected packages
Package configuration lets one package or sub-package use different logging settings than the root logger.
err := logy.LoadConfig(&logy.Config{
Level: logy.LevelInfo,
Packages: logy.PackageConfigs{
"billing/internal/sql": {
Level: logy.LevelWarn,
},
},
})
if err != nil {
panic(err)
}Use package configuration when a noisy package should log less, or when a specific package should write to a separate handler.
Package configuration works best with named loggers. Continue with Loggers when different parts of the application need different logging behavior.
