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

Add Node Id to peertest logs #857

Open
njgheorghita opened this issue Aug 23, 2023 · 1 comment
Open

Add Node Id to peertest logs #857

njgheorghita opened this issue Aug 23, 2023 · 1 comment
Labels
good-community-issue shelf-stable Will not be closed by stale-bot

Comments

@njgheorghita
Copy link
Collaborator

When running peertest, the logs from every peertest node are concurrently output while the test is run. This makes it very difficult to tell which log is emitted from which node. What we want is to add the node id (just a 6 character prefix, not the entire node id) from each node to every log that it outputs, so that we can tell from where the log originates.

I'm not sure the best way to implement this, it'll likely take some digging around the various logging tools / libraries we use...

A glimpse into the desired behavior is to add the with_thread_ids modifier to where we build the tracing subscriber for use in peertest. This will add a prefix to every log that contains the thread id from which that log originates. Of course, rather than the thread id, we want the node id for the respective node. But this example is just to get an idea of the desired behavior, not necessarily the best way to achieve the result.

        let subscriber = tracing_subscriber::fmt()
            .with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
            .with_thread_id(true)
            .with_ansi(trin_utils::log::detect_ansi_support())
            .finish();
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

This issue is stale because it has been open for 42 days with no activity.

@github-actions github-actions bot added the stale label Oct 5, 2023
@njgheorghita njgheorghita added shelf-stable Will not be closed by stale-bot and removed stale labels Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-community-issue shelf-stable Will not be closed by stale-bot
Projects
None yet
Development

No branches or pull requests

1 participant