Skip to content

Commit 35ebfc7

Browse files
committed
Use --warn as default log level for tedge cli
Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
1 parent 7c027a1 commit 35ebfc7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

crates/common/tedge_config/src/cli.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ pub struct LogConfigArgs {
4343
pub log_level: Option<tracing::Level>,
4444
}
4545

46+
impl LogConfigArgs {
47+
pub fn with_default_level(self, log_level: tracing::Level) -> Self {
48+
Self {
49+
log_level: self.log_level.or(Some(log_level)),
50+
..self
51+
}
52+
}
53+
}
54+
4655
fn log_level_completions() -> Vec<CompletionCandidate> {
4756
use tracing::Level as L;
4857
let options = [L::TRACE, L::DEBUG, L::INFO, L::WARN, L::ERROR];

crates/core/tedge/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async fn main() -> anyhow::Result<()> {
7373

7474
log_init(
7575
"tedge",
76-
&common.log_args,
76+
&common.log_args.with_default_level(tracing::Level::WARN),
7777
&tedge_config_location.tedge_config_root_path,
7878
)?;
7979

0 commit comments

Comments
 (0)