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

feat(nat): add binary to probe for NAT status #1678

Merged
merged 10 commits into from
May 15, 2024
Merged

feat(nat): add binary to probe for NAT status #1678

merged 10 commits into from
May 15, 2024

Conversation

b-zee
Copy link
Contributor

@b-zee b-zee commented May 7, 2024

This binary will help a machine figure out its NAT status. For this to
work a public machine runs the binary, while a peer asks the public
machine for a dial-back.

This binary will help a machine figure out its NAT status. For this to
work a public machine runs the binary, while a peer asks the public
machine for a dial-back.
@b-zee b-zee marked this pull request as ready for review May 14, 2024 16:41
Comment on lines +65 to +75
let registry = tracing_subscriber::registry().with(tracing_subscriber::fmt::layer());
// Use `RUST_LOG` if set, else use the verbosity flag (where `-vvvv` is trace level).
let _ = if std::env::var_os("RUST_LOG").is_some() {
registry.with(EnvFilter::from_env("RUST_LOG")).try_init()
} else {
let filter = tracing_subscriber::filter::Targets::new().with_target(
env!("CARGO_BIN_NAME").replace('-', "_"),
opt.verbose.log_level_filter().as_trace(),
);
registry.with(filter).try_init()
};
Copy link
Member

Choose a reason for hiding this comment

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

Maybe in a follow up PR can we make use of sn_logging here? I think it will be useful to have the logs inside a single place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, kind of agree, though I think it's quite compact code here that isn't too complex. I didn't think it would be useful to log to files etc.

Copy link
Member

@RolandSherwin RolandSherwin left a comment

Choose a reason for hiding this comment

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

🚀

@b-zee b-zee enabled auto-merge May 15, 2024 15:16
@b-zee b-zee added this pull request to the merge queue May 15, 2024
Merged via the queue into maidsafe:main with commit 09246c2 May 15, 2024
35 checks passed
@b-zee b-zee deleted the feat-autonat-probing branch May 15, 2024 16:18
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.

2 participants