mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-12-22 04:18:21 -05:00
feat: add an option to enable/disable debug mode
This commit is contained in:
parent
141aacc82a
commit
d4df90160d
@ -19,7 +19,7 @@ async fn main() -> std::io::Result<()> {
|
||||
let config = Config::parse().unwrap();
|
||||
|
||||
// Initializing logging middleware with level set to default or info.
|
||||
if config.logging {
|
||||
if config.logging || config.debug{
|
||||
use env_logger::Env;
|
||||
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ pub struct Config {
|
||||
pub redis_connection_url: String,
|
||||
pub aggregator: AggreatorConfig,
|
||||
pub logging: bool,
|
||||
pub debug: bool,
|
||||
}
|
||||
|
||||
/// Configuration options for the aggregator.
|
||||
@ -73,6 +74,7 @@ impl Config {
|
||||
redis_connection_url: globals.get::<_, String>("redis_connection_url")?,
|
||||
aggregator: aggregator_config,
|
||||
logging: globals.get::<_, bool>("logging")?,
|
||||
debug: globals.get::<_, bool>("debug")?,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
-- ### General ###
|
||||
logging = true -- an option to enable or disable logs.
|
||||
debug = false -- an option to enable or disable debug mode.
|
||||
|
||||
-- ### Server ###
|
||||
port = "8080" -- port on which server should be launched
|
||||
|
Loading…
Reference in New Issue
Block a user