From d638cc33b9547ca9addc8e2897a425d700364ffd Mon Sep 17 00:00:00 2001 From: Adi Seredinschi Date: Wed, 20 Jan 2021 19:25:28 +0100 Subject: [PATCH] Added operation instructions. --- relayer-cli/relayer_operation_instructions.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/relayer-cli/relayer_operation_instructions.md b/relayer-cli/relayer_operation_instructions.md index ca672ff795..ee726f4aed 100644 --- a/relayer-cli/relayer_operation_instructions.md +++ b/relayer-cli/relayer_operation_instructions.md @@ -279,3 +279,44 @@ Jan 20 11:28:47.842 INFO relayer::macros::profiling: ⏳ inner operation - s Jan 20 11:28:49.846 INFO relayer::macros::profiling: ⏳ inner operation - elapsed: 2004ms Jan 20 11:28:49.847 INFO relayer::macros::profiling: ⏳ myfunction: x=42 - elapsed: 3005ms ``` + +## Parametrizing the log output level + +The relayer configuration file, called `loop_config.toml` in the examples above +permits parametrization of output verbosity via the knob called `log_level`. +Relevant snippet: + +```toml +[global] +timeout = '10s' +strategy = 'naive' +log_level = 'error' +``` + +Valid options for `log_level` are: 'error', 'warn', 'info', 'debug', 'trace'. +These levels correspond to the tracing sub-component of the relayer-cli, [see +here](https://docs.rs/tracing-core/0.1.17/tracing_core/struct.Level.html). + +The relayer will _always_ print a last line summarizing the result of its +operation for queries of transactions. In addition to this last line, +arbitrary debug, info, or other outputs may be produced. Example, with +`log_level = 'debug'`: + +```bash +Running `target/debug/relayer -c loop_config.toml query client consensus ibc-0 07-tendermint-X 0 1` +{"timestamp":"Jan 20 19:21:52.070","level":"DEBUG","fields":{"message":"registered component: abscissa_core::terminal::component::Terminal (v0.5.2)"},"target":"abscissa_core::component::registry"} +{"timestamp":"Jan 20 19:21:52.071","level":"DEBUG","fields":{"message":"registered component: relayer_cli::components::Tracing (v0.0.6)"},"target":"abscissa_core::component::registry"} +{"timestamp":"Jan 20 19:21:52.078","level":"INFO","fields":{"message":"Options QueryClientConsensusOptions { client_id: ClientId(\"07-tendermint-X\"), revision_number: 0, revision_height: 1, height: 0, proof: true }"},"target":"relayer_cli::commands::query::client"} +{"timestamp":"Jan 20 19:21:52.080","level":"DEBUG","fields":{"message":"resolving host=\"localhost\""},"target":"hyper::client::connect::dns"} +{"timestamp":"Jan 20 19:21:52.083","level":"DEBUG","fields":{"message":"connecting to [::1]:26657"},"target":"hyper::client::connect::http"} +{"timestamp":"Jan 20 19:21:52.083","level":"DEBUG","fields":{"message":"connecting to 127.0.0.1:26657"},"target":"hyper::client::connect::http"} +{"status":"error","result":["query error: RPC error to endpoint tcp://localhost:26657: error trying to connect: tcp connect error: Connection refused (os error 61) (code: 0)"]} +``` + +For the same command, with `log_level = 'error'`, just the last line will be +produced: + +```bash + Running `target/debug/relayer -c loop_config.toml query client consensus ibc-0 07-tendermint-X 0 1` +{"status":"error","result":["query error: RPC error to endpoint tcp://localhost:26657: error trying to connect: tcp connect error: Connection refused (os error 61) (code: 0)"]} +``` \ No newline at end of file