feat(rust): add initial rust template
This commit is contained in:
32
rust/src/main.rs
Normal file
32
rust/src/main.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use clap::Parser;
|
||||
use tracing::{Level, event};
|
||||
|
||||
mod args;
|
||||
use args::CommandArgs;
|
||||
|
||||
mod config;
|
||||
|
||||
use crate::args::ActionType;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let args = CommandArgs::parse();
|
||||
|
||||
match &args.action {
|
||||
ActionType::Serve(serve_args) => {
|
||||
tracing_subscriber::fmt()
|
||||
.with_max_level(serve_args.log_level)
|
||||
.init();
|
||||
|
||||
event!(Level::ERROR, "error");
|
||||
event!(Level::WARN, "warn");
|
||||
event!(Level::INFO, "info");
|
||||
event!(Level::DEBUG, "debug");
|
||||
event!(Level::TRACE, "trace");
|
||||
|
||||
println!("{:#?}", args);
|
||||
|
||||
// println!("{:#?}", config);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user