-
Notifications
You must be signed in to change notification settings - Fork 880
Tracing cleanup #7168
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
Merged
Merged
Tracing cleanup #7168
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d063422
Cleanup
macladson ab8b8cf
cargo sort
macladson 1c5043b
cargo udeps
macladson 9d08e77
Fix target name for gossipsub
ackintosh ed693db
Merge pull request #4 from ackintosh/tracing-cleanup-fix-gossipsub
macladson 581c788
Merge branch 'unstable' into tracing-cleanup
macladson 6f5d316
Rename macro and use EnvFilter for dep logging
macladson 6e48dd4
Visibility and macro fixes
macladson 764f0bb
Add docs and fix typo
macladson ef89437
Formatting
macladson d3278bc
Merge branch 'unstable' into tracing-cleanup
jimmygchen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "lighthouse_macros" | ||
macladson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
version = "0.1.0" | ||
edition = { workspace = true } | ||
|
||
[lib] | ||
proc-macro = true | ||
|
||
[dependencies] | ||
cargo_metadata = { workspace = true } | ||
proc-macro2 = { workspace = true } | ||
macladson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
quote = { workspace = true } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use cargo_metadata::MetadataCommand; | ||
use proc_macro::TokenStream; | ||
use quote::quote; | ||
use std::error::Error; | ||
|
||
fn get_workspace_crates() -> Result<Vec<String>, Box<dyn Error>> { | ||
let metadata = MetadataCommand::new().no_deps().exec()?; | ||
|
||
Ok(metadata | ||
.workspace_members | ||
.iter() | ||
.filter_map(|member_id| { | ||
metadata | ||
.packages | ||
.iter() | ||
.find(|package| &package.id == member_id) | ||
.map(|package| package.name.clone()) | ||
}) | ||
.collect()) | ||
} | ||
|
||
#[proc_macro] | ||
pub fn workspace_crates(_input: TokenStream) -> TokenStream { | ||
macladson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
match get_workspace_crates() { | ||
Ok(crate_names) => { | ||
let crate_strs = crate_names.iter().map(|s| s.as_str()); | ||
quote! { | ||
Ok(&[#(#crate_strs),*]) | ||
} | ||
} | ||
Err(e) => { | ||
let error_msg = e.to_string(); | ||
quote! { | ||
Err(#error_msg) | ||
} | ||
} | ||
} | ||
.into() | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.