- fix: warnings about unused variables

- add: LOG_LEVEL env variable
This commit is contained in:
2024-11-26 13:15:33 -05:00
parent e494860e9a
commit 815cb210dc
3 changed files with 15 additions and 17 deletions

View File

@@ -6,9 +6,10 @@ use auth_service::grpc::MyAuthService;
use dotenv::dotenv;
use std::env;
use std::net::ToSocketAddrs;
use std::str::FromStr;
use tokio::{select, signal};
use tonic::transport::Server;
use tracing::info;
use tracing::{info, Level};
use warp::Filter;
mod consul_registration;
@@ -20,9 +21,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
dotenv().ok();
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.with_thread_names(true)
.with_timer(tracing_subscriber::fmt::time::ChronoLocal::rfc_3339())
.with_max_level(Level::from_str(&env::var("LOG_LEVEL").unwrap_or_else(|_| "info".to_string())).unwrap_or_else(|_| Level::INFO))
.init();
// Set the gRPC server address