Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Fix debug logging #4739

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func GetCommand() *cobra.Command {
// NOTE(dshulyak) this needs to be max level so that child logger can can be current level or below.
// otherwise it will fail later when child logger will try to increase level.
WithLog(log.RegisterHooks(
log.NewWithLevel("node", zap.NewAtomicLevelAt(zap.InfoLevel)),
log.NewWithLevel("node", zap.NewAtomicLevelAt(zap.DebugLevel)),
events.EventHook()),
),
)
Expand Down Expand Up @@ -294,7 +294,12 @@ func New(opts ...Option) *App {
for _, opt := range opts {
opt(app)
}
log.SetupGlobal(app.log)
// TODO(mafa): this is a hack to suppress debugging logs on 0000.defaultLogger
// to fix this we should get rid of the global logger and pass app.log to all
// components that need it
lvl := zap.NewAtomicLevelAt(zap.InfoLevel)
log.SetupGlobal(app.log.SetLevel(&lvl))

types.SetNetworkHRP(app.Config.NetworkHRP)
return app
}
Expand Down