Private
Public Access
1
0

client: implements event/updates websocket

This commit is contained in:
2025-05-01 18:07:18 -07:00
parent 13a78ccd47
commit f6ac3b5a58
14 changed files with 561 additions and 67 deletions

View File

@@ -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