client: implements event/updates websocket
This commit is contained in:
@@ -5,6 +5,7 @@ mod daemon;
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::{Parser, Subcommand};
|
||||
use log::LevelFilter;
|
||||
|
||||
/// A command line interface for the Kordophone library and daemon
|
||||
#[derive(Parser)]
|
||||
@@ -43,8 +44,22 @@ async fn run_command(command: Commands) -> Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
fn initialize_logging() {
|
||||
// Weird: is this the best way to do this?
|
||||
let log_level = std::env::var("RUST_LOG")
|
||||
.map(|s| s.parse::<LevelFilter>().unwrap_or(LevelFilter::Info))
|
||||
.unwrap_or(LevelFilter::Info);
|
||||
|
||||
env_logger::Builder::from_default_env()
|
||||
.format_timestamp_secs()
|
||||
.filter_level(log_level)
|
||||
.init();
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
initialize_logging();
|
||||
|
||||
let cli = Cli::parse();
|
||||
|
||||
run_command(cli.command).await
|
||||
|
||||
Reference in New Issue
Block a user