Add logger configuration hook (#10440)

* Initial poc

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Make config available to logger hook

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* fmt

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Fix tests

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* fmt

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Add metric prefix option in sc_cli::RunCmd

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Remove print

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Review fixes

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* fmt

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* fix docs

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
This commit is contained in:
sandreim
2021-12-16 13:18:24 +02:00
committed by GitHub
parent f99307b600
commit 9b73a8a6fc
7 changed files with 148 additions and 41 deletions
@@ -622,11 +622,11 @@ fn wasm_tracing_should_work(wasm_method: WasmExecutionMethod) {
struct TestTraceHandler(Arc<Mutex<Vec<SpanDatum>>>);
impl sc_tracing::TraceHandler for TestTraceHandler {
fn handle_span(&self, sd: SpanDatum) {
self.0.lock().unwrap().push(sd);
fn handle_span(&self, sd: &SpanDatum) {
self.0.lock().unwrap().push(sd.clone());
}
fn handle_event(&self, _event: TraceEvent) {}
fn handle_event(&self, _event: &TraceEvent) {}
}
let traces = Arc::new(Mutex::new(Vec::new()));