Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
88c1f42
Initial commit
cecton Oct 7, 2020
95762f1
WIP
cecton Oct 9, 2020
685c122
WIP
cecton Oct 14, 2020
fea1d0c
WIP
cecton Oct 14, 2020
f0d5964
WIP
cecton Oct 15, 2020
a55ccf0
WIP
cecton Oct 15, 2020
ad7dbd5
CLEANUP
cecton Oct 15, 2020
c8e0841
Add notes to original source code
cecton Oct 15, 2020
dc2f401
CLEANUP
cecton Oct 15, 2020
34106dd
CLEANUP
cecton Oct 15, 2020
76f2d43
WIP
cecton Oct 15, 2020
0c278a8
WIP
cecton Oct 16, 2020
8257480
WIP
cecton Oct 16, 2020
47f7d3f
CLEANUP
cecton Oct 16, 2020
efb9b82
WIP
cecton Oct 16, 2020
346eaf1
Some doc
cecton Oct 16, 2020
9055ec2
Test with trybuild
cecton Oct 16, 2020
d46d87b
Revert "Test with trybuild" (issue with trybuild atm)
cecton Oct 16, 2020
2401a7c
Apply suggestions
cecton Oct 16, 2020
364b1b9
Merge commit ec1834646c3f81305dd01cc85d003d7be76daebf (no conflict)
cecton Oct 16, 2020
25970af
Rename derive to proc-macro
cecton Oct 16, 2020
8480619
Remove "prefix" feature from informant
cecton Oct 16, 2020
b14c3f8
Blocking task should use SpawnHandle::spawn_blocking
cecton Oct 16, 2020
499ade7
Improve doc as suggested
cecton Oct 16, 2020
aea5b53
Fixes
cecton Oct 16, 2020
0c83890
Apply suggestion
cecton Oct 16, 2020
2e6b613
Update client/cli/proc-macro/src/lib.rs
cecton Oct 21, 2020
3f61450
More suggestions
cecton Oct 21, 2020
a554480
CLEANUP
cecton Oct 21, 2020
58a7284
Improve error message
cecton Oct 21, 2020
de4678f
CLEANUP
cecton Oct 21, 2020
c101a09
Fix async issue
cecton Oct 21, 2020
35ae152
CLEANUP
cecton Oct 21, 2020
fb4c7bb
CLEANUP
cecton Oct 21, 2020
2238794
Add test
cecton Oct 21, 2020
c4e0039
fix doc test
cecton Oct 21, 2020
1a72fc5
Merge commit c2469ebdfbb9d051f892c7b896e835d78d60838d (no conflict)
cecton Oct 21, 2020
2752062
Update client/cli/src/logging.rs
cecton Oct 21, 2020
208bbe2
Update client/basic-authorship/src/basic_authorship.rs
cecton Oct 21, 2020
243dd6c
Update client/basic-authorship/src/basic_authorship.rs
cecton Oct 21, 2020
929bd1e
Apply suggestions
cecton Oct 21, 2020
f12a3f7
Suggestions
cecton Oct 21, 2020
b9d7723
Clarify doc
cecton Oct 21, 2020
f141b73
WIP
cecton Oct 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions
  • Loading branch information
cecton committed Oct 16, 2020
commit 2401a7ca12b271c3f3dd902e3e86bf0ead1be293
5 changes: 4 additions & 1 deletion client/cli/derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ pub fn substrate_cli_node_name(arg: TokenStream, item: TokenStream) -> TokenStre

let name = syn::parse_macro_input!(arg as Expr);

let crate_name = if std::env::var("CARGO_PKG_NAME").unwrap() == "sc-cli" {
let crate_name = if std::env::var("CARGO_PKG_NAME")
.expect("cargo env var always there when compiling; qed")
== "sc-cli"
{
Ident::new("sc_cli", Span::call_site().into())
} else {
let crate_name = match crate_name("sc-cli") {
Expand Down
6 changes: 3 additions & 3 deletions client/cli/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub(crate) struct EventFormat<T = SystemTime> {
pub(crate) display_thread_name: bool,
}

// NOTE: the following code has been inspiref from tracing-subscriber
// NOTE: the following code took inspiration from tracing-subscriber
//
// https://github.com/tokio-rs/tracing/blob/2f59b32/tracing-subscriber/src/fmt/format/mod.rs#L449
impl<S, N, T> FormatEvent<S, N> for EventFormat<T>
Copy link
Member

Choose a reason for hiding this comment

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

Do we really require that much copied code to get this working? Isn't there something to insert a new field much easier?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wish 😂

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you elaborate a bit on what the problem was that made all of this copying necessary?

Copy link
Member

Choose a reason for hiding this comment

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

Expand Down Expand Up @@ -138,7 +138,7 @@ macro_rules! write_node_name {
($method:ident, $type:ty, $format:expr) => {
fn $method(&mut self, field: &tracing::field::Field, value: $type) {
if field.name() == "name" {
write!(self.0, $format, value).unwrap();
write!(self.0, $format, value).expect("no way to return the err; qed");
}
}
};
Expand Down Expand Up @@ -274,7 +274,7 @@ where
}
}

// NOTE: the following code has been inspired from tracing-subscriber
// NOTE: the following code took inspiration from tracing-subscriber
//
// https://github.com/tokio-rs/tracing/blob/2f59b32/tracing-subscriber/src/fmt/format/mod.rs#L711
impl<'a, S, N: 'a> fmt::Display for FmtCtx<'a, S, N>
Expand Down