Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Use tracing-based subscriber logging #6825

Merged
merged 37 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b866b7c
init_logger: switch from log-based to tracing-based and add compatibi…
sorpaas Aug 4, 2020
5180a85
Move tracing profiling subscriber related config realization
sorpaas Aug 4, 2020
0574519
sp-tracing: change profiling to be a layer instead of a subscriber
sorpaas Aug 5, 2020
036d066
Enable profiling layer in cli
sorpaas Aug 5, 2020
bf668a7
Change all test env_logger init to sp_tracing::try_init_simple
sorpaas Aug 5, 2020
9c2f0e5
Remove all local env_logger dependency
sorpaas Aug 5, 2020
eaccb6f
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Aug 5, 2020
bd55848
Add missing tracing-subscriber dependency
sorpaas Aug 5, 2020
0d77611
frame-sudo: fix tests
sorpaas Aug 6, 2020
4acd09f
frame-support: fix tests
sorpaas Aug 6, 2020
3af13c6
Fix frame/pallet and executor tests
sorpaas Aug 6, 2020
fbefaff
Fix the remaining tests
sorpaas Aug 6, 2020
08b70e7
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Aug 6, 2020
d161fdb
Use subscriber's try_init as recommended by @davidbarsky
sorpaas Aug 6, 2020
cd71049
Be explict that the tracing-log feature is needed
sorpaas Aug 6, 2020
86da560
Set subscriber writer to stderr
sorpaas Aug 6, 2020
3eb5daf
Shorter line width
sorpaas Aug 6, 2020
6490ad3
Update cargo lock tracing version
sorpaas Aug 6, 2020
d3b5bdf
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Aug 19, 2020
03562af
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Sep 6, 2020
9e1bce4
Fix sc_tracing crate compile
sorpaas Sep 6, 2020
635812f
Fix sc_authority_discovery crate test
sorpaas Sep 6, 2020
24af3bf
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Sep 9, 2020
14f304e
unremove default-features
sorpaas Sep 9, 2020
02835a5
Leave enabled to default true
sorpaas Sep 9, 2020
a23f9ec
Warn if global default cannot be set
sorpaas Sep 9, 2020
a13b04c
Fix unused import
sorpaas Sep 9, 2020
49522c4
Remove unused PROXY_TARGET
sorpaas Sep 10, 2020
9ab3ce7
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Sep 11, 2020
763c26d
Change all reference from rc5 to rc6
sorpaas Sep 11, 2020
bf0c787
Change all reference of rc2 to rc6
sorpaas Sep 11, 2020
09202c7
Fix styling
sorpaas Sep 11, 2020
b3d5b6c
Fix typo
sorpaas Sep 11, 2020
03cddb7
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Sep 13, 2020
33ade01
make logger init error'ing
gnunicorn Sep 17, 2020
a7091d4
Merge remote-tracking branch 'origin/master' into sp-tracing-small
gnunicorn Sep 17, 2020
50ed0fe
re-fixing the test issue
gnunicorn Sep 17, 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
33 changes: 18 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bin/node/bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ sc-basic-authorship = { version = "0.8.0-rc6", path = "../../../client/basic-aut
sp-inherents = { version = "2.0.0-rc6", path = "../../../primitives/inherents" }
sp-finality-tracker = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/finality-tracker" }
sp-timestamp = { version = "2.0.0-rc6", default-features = false, path = "../../../primitives/timestamp" }
sp-tracing = { version = "2.0.0-rc6", path = "../../../primitives/tracing" }
hash-db = "0.15.2"
tempfile = "3.1.0"
fs_extra = "1"
Expand Down
2 changes: 1 addition & 1 deletion bin/node/bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn main() {
let opt = Opt::from_args();

if !opt.json {
sc_cli::init_logger("");
sp_tracing::try_init_simple();
}

let mut import_benchmarks = Vec::new();
Expand Down
2 changes: 1 addition & 1 deletion bin/node/rpc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ repository = "https://github.com/paritytech/substrate/"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
env_logger = "0.7.0"
futures = "0.1.29"
hyper = "0.12.35"
jsonrpc-core-client = { version = "14.2.0", default-features = false, features = ["http"] }
log = "0.4.8"
node-primitives = { version = "2.0.0-rc6", path = "../primitives" }
sp-tracing = { version = "2.0.0-rc6", path = "../../../primitives/tracing" }
sc-rpc = { version = "2.0.0-rc6", path = "../../../client/rpc" }
2 changes: 1 addition & 1 deletion bin/node/rpc-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use jsonrpc_core_client::{
};

fn main() {
env_logger::init();
sp_tracing::try_init_simple();

rt::run(rt::lazy(|| {
let uri = "http://localhost:9933";
Expand Down
2 changes: 1 addition & 1 deletion client/authority-discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sp-runtime = { version = "2.0.0-rc6", path = "../../primitives/runtime" }
sp-api = { version = "2.0.0-rc6", path = "../../primitives/api" }

[dev-dependencies]
env_logger = "0.7.0"
quickcheck = "0.9.0"
sp-tracing = { version = "2.0.0-rc6", path = "../../primitives/tracing" }
sc-peerset = { version = "2.0.0-rc6", path = "../peerset" }
substrate-test-runtime-client = { version = "2.0.0-rc6", path = "../../test-utils/runtime/client"}
4 changes: 2 additions & 2 deletions client/authority-discovery/src/worker/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ fn new_registers_metrics() {

#[test]
fn triggers_dht_get_query() {
let _ = ::env_logger::try_init();
sp_tracing::try_init_simple();
let (_dht_event_tx, dht_event_rx) = channel(1000);

// Generate authority keys
Expand Down Expand Up @@ -321,7 +321,7 @@ fn triggers_dht_get_query() {

#[test]
fn publish_discover_cycle() {
let _ = ::env_logger::try_init();
sp_tracing::try_init_simple();

// Node A publishing its address.

Expand Down
4 changes: 3 additions & 1 deletion client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
derive_more = "0.99.2"
env_logger = "0.7.0"
log = "0.4.8"
atty = "0.2.13"
regex = "1.3.4"
Expand Down Expand Up @@ -50,6 +49,9 @@ sc-tracing = { version = "2.0.0-rc6", path = "../tracing" }
chrono = "0.4.10"
parity-util-mem = { version = "0.7.0", default-features = false, features = ["primitive-types"] }
serde = "1.0.111"
tracing = "0.1.10"
tracing-log = "0.1.1"
tracing-subscriber = "0.2.10"

[target.'cfg(not(target_os = "unknown"))'.dependencies]
rpassword = "4.0.1"
Expand Down
8 changes: 6 additions & 2 deletions client/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
Ok(self.shared_params().log_filters().join(","))
}

/// Initialize substrate. This must be done only once.
/// Initialize substrate. This must be done only once per process.
///
/// This method:
///
Expand All @@ -537,10 +537,14 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
/// 3. Raises the FD limit
fn init<C: SubstrateCli>(&self) -> Result<()> {
let logger_pattern = self.log_filters()?;
let tracing_receiver = self.tracing_receiver()?;
let tracing_targets = self.tracing_targets()?;

sp_panic_handler::set(&C::support_url(), &C::impl_version());

init_logger(&logger_pattern);
if let Err(e) = init_logger(&logger_pattern, tracing_receiver, tracing_targets) {
log::warn!("💬 Problem initializing global logging framework: {:}", e)
}

if let Some(new_limit) = fdlimit::raise_fd_limit() {
if new_limit < RECOMMENDED_OPEN_FILE_DESCRIPTOR_LIMIT {
Expand Down
Loading