diff options
| author | seth <[email protected]> | 2024-05-27 04:55:45 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2024-05-27 04:56:48 -0400 |
| commit | c69eea2f4823da476628742fbbec600ee95ac049 (patch) | |
| tree | 7cf3d87f5f202e6049ba44a06ac6fe9d3558826b /src/main.rs | |
initial commit
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..3a604ba --- /dev/null +++ b/src/main.rs @@ -0,0 +1,29 @@ +use eyre::Result; +use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; + +mod client; +mod command; +mod handler; +mod http; + +fn init_logging() { + let fmt_layer = tracing_subscriber::fmt::layer().pretty(); + let env_filter = tracing_subscriber::EnvFilter::try_from_default_env() + .unwrap_or_else(|_| "nixpkgs_discord_tracker=info,warn".into()); + + tracing_subscriber::registry() + .with(fmt_layer) + .with(env_filter) + .init(); +} + +#[tokio::main] +async fn main() -> Result<()> { + dotenvy::dotenv().ok(); + init_logging(); + + let mut client = client::get().await; + client.start().await?; + + Ok(()) +} |
