Skip to content

Commit

Permalink
Overrriding default tracing cfg [WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
adizere committed Jan 12, 2021
1 parent 90b885f commit fb2e270
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
21 changes: 18 additions & 3 deletions relayer-cli/src/application.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
//! Cli Abscissa Application

use crate::{commands::CliCmd, config::Config};
use abscissa_core::{
application::{self, AppCell},
config, trace, Application, EntryPoint, FrameworkError, StandardPaths,
component::Component,
Application, config, EntryPoint, FrameworkError, StandardPaths, trace,
};

use crate::{commands::CliCmd, config::Config, components::Tracing};

/// Application state
pub static APPLICATION: AppCell<CliApp> = AppCell::new();

Expand Down Expand Up @@ -76,13 +78,26 @@ impl Application for CliApp {
&mut self.state
}

fn framework_components(
&mut self,
command: &Self::Cmd,
) -> Result<Vec<Box<dyn Component<Self>>>, FrameworkError> {
Ok(vec![])
}

/// Register all components used by this application.
///
/// If you would like to add additional components to your application
/// beyond the default ones provided by the framework, this is the place
/// to do so.
fn register_components(&mut self, command: &Self::Cmd) -> Result<(), FrameworkError> {
let components = self.framework_components(command)?;
let mut components = self.framework_components(command)?;

tracing::info!("pre-push");
let c = Tracing::new()?;
components.push(Box::new(c));
tracing::info!("post-push");

self.state.components.register(components)
}

Expand Down
3 changes: 3 additions & 0 deletions relayer-cli/src/commands/query/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ impl QueryConnectionChannelsCmd {
impl Runnable for QueryConnectionChannelsCmd {
fn run(&self) {
let config = app_config();
tracing::debug!("post-push ^2");
tracing::info!("post-push ^2");
tracing::error!("ERROROROOROR");

let (chain_config, opts) = match self.validate_options(&config) {
Err(err) => {
Expand Down
1 change: 1 addition & 0 deletions relayer-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ mod conclude;
pub mod config;
pub mod error;
pub mod prelude;
mod components;

0 comments on commit fb2e270

Please sign in to comment.