Add tokio console to the config
This commit is contained in:
2 files changed
+11
-1
No files matched your search
@@ -27,6 +27,9 @@ pub(crate) struct Config {
|
||||
#[serde(default = "default_bind_port")]
|
||||
pub(crate) bind_port: u16,
|
||||
|
||||
#[serde(default = "default_tokio_console")]
|
||||
pub(crate) tokio_console: bool,
|
||||
|
||||
#[serde(default = "default_certificate")]
|
||||
pub(crate) certificate: Option<String>,
|
||||
|
||||
@@ -192,6 +195,10 @@ fn default_tls_client_auth() -> String {
|
||||
"none".to_string()
|
||||
}
|
||||
|
||||
fn default_tokio_console() -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn default_channel_id() -> u8 {
|
||||
0
|
||||
}
|
||||
|
||||
+4
-1
@@ -58,7 +58,6 @@ fn tokio_console_enable() {
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
|
||||
tokio_console_enable();
|
||||
|
||||
info!(
|
||||
"Neolink {} {}",
|
||||
@@ -79,6 +78,10 @@ async fn main() -> Result<()> {
|
||||
.validate()
|
||||
.with_context(|| format!("Failed to validate the {:?} config file", conf_path))?;
|
||||
|
||||
if config.tokio_console {
|
||||
tokio_console_enable();
|
||||
}
|
||||
|
||||
match opt.cmd {
|
||||
None => {
|
||||
warn!(
|
||||
|
||||
Reference in new issue
Block a user