mirror of
https://github.com/shiroyashik/sculptor.git
synced 2025-12-06 04:51:13 +03:00
set log levels
This commit is contained in:
parent
e6f3a4f7a4
commit
92d2a0d906
1 changed files with 5 additions and 5 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -4,9 +4,7 @@ use axum::{
|
||||||
routing::{delete, get, post, put},
|
routing::{delete, get, post, put},
|
||||||
Router,
|
Router,
|
||||||
};
|
};
|
||||||
use chrono::prelude::*;
|
|
||||||
use dashmap::DashMap;
|
use dashmap::DashMap;
|
||||||
use fern::colors::{Color, ColoredLevelConfig};
|
|
||||||
use log::info;
|
use log::info;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::{broadcast, Mutex};
|
use tokio::sync::{broadcast, Mutex};
|
||||||
|
|
@ -99,13 +97,15 @@ pub struct AppState {
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
tracing_subscriber::fmt::fmt()
|
tracing_subscriber::fmt::fmt()
|
||||||
.with_env_filter("trace")
|
.with_env_filter("trace,axum=info,tower_http=info,tokio=info,tungstenite=info,tokio_tungstenite=info")
|
||||||
.pretty()
|
.pretty()
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
|
let config_file = std::env::var("CONFIG_PATH").unwrap_or_else(|_| "Config.toml".into());
|
||||||
|
|
||||||
info!("The Sculptor MMSI edition v{}", env!("CARGO_PKG_VERSION"));
|
info!("The Sculptor MMSI edition v{}", env!("CARGO_PKG_VERSION"));
|
||||||
// Config
|
// Config
|
||||||
let config = config::Config::parse("Config.toml".into());
|
let config = config::Config::parse(config_file.clone().into());
|
||||||
let listen = config.listen.as_str();
|
let listen = config.listen.as_str();
|
||||||
|
|
||||||
// State
|
// State
|
||||||
|
|
@ -122,7 +122,7 @@ async fn main() -> Result<()> {
|
||||||
loop {
|
loop {
|
||||||
tokio::time::sleep(std::time::Duration::from_secs(10)).await;
|
tokio::time::sleep(std::time::Duration::from_secs(10)).await;
|
||||||
|
|
||||||
let new_config = config::Config::parse("Config.toml".into()).advanced_users;
|
let new_config = config::Config::parse(config_file.clone().into()).advanced_users;
|
||||||
let mut config = advanced_users.lock().await;
|
let mut config = advanced_users.lock().await;
|
||||||
|
|
||||||
if new_config != *config {
|
if new_config != *config {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue