Skip to content

Commit dbe83ed

Browse files
author
e1732a364fed
committed
mi
1 parent 3eb854c commit dbe83ed

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

crates/ruci-cmd/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,10 @@ fn log_setup(args: Args) -> Option<tracing_appender::non_blocking::WorkerGuard>
517517

518518
println!("Mode: {:?}", args.mode);
519519
println!("Config: {}", args.config);
520-
println!("LogLevel(flag): {:?}", args.log_level);
520+
match args.log_level {
521+
Some(ll) => println!("LogLevel(flag): {}", ll),
522+
None => println!("LogLevel(flag): none"),
523+
}
521524

522525
const RL: &str = "RUST_LOG";
523526

rucimp/src/modes/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ pub enum Mode {
2424
#[derive(Debug, Clone, Copy)]
2525
pub struct LevelWrapper(pub tracing::Level);
2626

27+
impl std::fmt::Display for LevelWrapper {
28+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29+
let s = match self.0 {
30+
Level::ERROR => "ERROR",
31+
Level::WARN => "WARN",
32+
Level::INFO => "INFO",
33+
Level::DEBUG => "DEBUG",
34+
Level::TRACE => "TRACE",
35+
};
36+
f.write_str(s)
37+
}
38+
}
39+
2740
#[cfg(feature = "api_server")]
2841
impl utoipa::PartialSchema for LevelWrapper {
2942
fn schema() -> utoipa::openapi::RefOr<utoipa::openapi::schema::Schema> {

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Refer to rucimp crate for config file format related implements and more proxy p
1313
pub mod map;
1414
pub mod net;
1515
pub mod relay;
16-
// pub mod user;
1716
pub mod utils;
1817

1918
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

0 commit comments

Comments
 (0)