logging: implement lazy sprinting (#8898)

shout out to @joeabbey for the inspiration. This makes the lazy
functions internal by default to prevent potential misuse by external
callers.

Should backport cleanly into 0.36 and I'll handle a messy merge into 0.35
This commit is contained in:
Sam Kleinman
2022-07-27 19:16:51 +00:00
committed by GitHub
parent b9d6bb4cd1
commit 48147e1fb9
20 changed files with 269 additions and 177 deletions
+2 -4
View File
@@ -469,12 +469,10 @@ func (r *Reactor) poolRoutine(ctx context.Context, stateSynced bool, blockSyncCh
lastAdvance = r.pool.LastAdvance()
)
r.logger.Debug(
"consensus ticker",
r.logger.Debug("consensus ticker",
"num_pending", numPending,
"total", lenRequesters,
"height", height,
)
"height", height)
switch {