fix: "Lazy" Stringers to defer Sprintf and Hash until logs print (#8845)

This commit is contained in:
Joe Abbey
2022-06-23 14:56:34 -04:00
committed by GitHub
parent a3cc3d98b9
commit 4a1df4911d
23 changed files with 226 additions and 115 deletions

View File

@@ -111,7 +111,7 @@ func startApp(cfg *Config) error {
if err != nil {
return err
}
logger.Info(fmt.Sprintf("Server listening on %v (%v protocol)", cfg.Listen, cfg.Protocol))
logger.Info("start app", "msg", log.NewLazySprintf("Server listening on %v (%v protocol)", cfg.Listen, cfg.Protocol))
return nil
}
@@ -261,7 +261,7 @@ func startSigner(cfg *Config) error {
if err != nil {
return err
}
logger.Info(fmt.Sprintf("Remote signer connecting to %v", cfg.PrivValServer))
logger.Info("start signer", "msg", log.NewLazySprintf("Remote signer connecting to %v", cfg.PrivValServer))
return nil
}