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

tracing for logging in fatxpool #6897

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dharjeezy
Copy link
Contributor

This PR modifies the fatxpool to use tracing instead of log for logging.

closes #5490

@dharjeezy
Copy link
Contributor Author

@michalkucharczyk you said i should let you know when i start with a single file, #5490 (comment)

@dharjeezy dharjeezy marked this pull request as ready for review December 28, 2024 12:15
Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the other logging calls similar to how I have done it in the suggestions?

Comment on lines +278 to +279
let tx_hash_string = format!("{:?}", tx_hash);
debug!(tx_hash_string, "dropped_watcher: removing (non-tracked) tx");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let tx_hash_string = format!("{:?}", tx_hash);
debug!(tx_hash_string, "dropped_watcher: removing (non-tracked) tx");
debug!(target: LOG_TARGET, ?tx_hash, "dropped_watcher: removing (non-tracked) tx");

@@ -100,10 +100,10 @@ where
///
/// `ready_iterator` is a closure that generates the result data to be sent to the pollers.
fn trigger(&mut self, at: Block::Hash, ready_iterator: impl Fn() -> T) {
log::trace!(target: LOG_TARGET, "fatp::trigger {at:?} pending keys: {:?}", self.pollers.keys());
tracing::trace!(target: LOG_TARGET, "fatp::trigger {at:?} pending keys: {:?}", self.pollers.keys());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tracing::trace!(target: LOG_TARGET, "fatp::trigger {at:?} pending keys: {:?}", self.pollers.keys());
tracing::trace!(target: LOG_TARGET, ?at, keys = ?self.poller.keys(), "fatp::trigger");

let Some(pollers) = self.pollers.remove(&at) else { return };
pollers.into_iter().for_each(|p| {
log::debug!(target: LOG_TARGET, "trigger ready signal at block {}", at);
tracing::debug!(target: LOG_TARGET, "trigger ready signal at block {}", at);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tracing::debug!(target: LOG_TARGET, "trigger ready signal at block {}", at);
tracing::debug!(target: LOG_TARGET, ?at, "trigger ready signal", at);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fatxpool: use tracing instead of log
2 participants