Skip to content

Commit f4b0f27

Browse files
author
Sh An
committed
Fix broken log
1 parent b4ad54a commit f4b0f27

3 files changed

Lines changed: 12 additions & 18 deletions

File tree

lore-base/src/log/mod.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,12 @@ pub fn dispatch_log(level: LoreLogLevel, location: &str, message: &str) {
7979

8080
#[macro_export]
8181
macro_rules! lore_trace {
82-
($fmt:expr $(, $arg:expr)* $(,)?) => {{
83-
#[cfg(not(feature = "trace_log"))]
84-
if false {
85-
let _ = core::format_args!($fmt $(, $arg)*);
86-
}
87-
#[cfg(feature = "trace_log")]
88-
if true {
89-
$crate::lore_log_event!(
90-
$crate::log::LoreLogLevel::Trace,
91-
$fmt $(, $arg)*
92-
)
93-
}
94-
}};
82+
($fmt:expr $(, $arg:expr)* $(,)?) => {
83+
$crate::lore_log_event!(
84+
$crate::log::LoreLogLevel::Trace,
85+
$fmt $(, $arg)*
86+
)
87+
};
9588
}
9689

9790
#[macro_export]

lore-client/src/cli/client_main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ pub fn client_main() -> ExitCode {
4141
cli.non_interactive,
4242
);
4343

44-
lore::log::initialize();
4544
lore::log::configure(&log_config);
4645

4746
if let Some(max_threads) = cli.max_threads {

lore/src/log.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,18 @@ pub fn log_level() -> LoreLogLevel {
6464
pub fn configure(config: &LoreLogConfig) {
6565
initialize();
6666

67-
if config.file == 0 {
68-
return;
69-
}
70-
7167
let mut config = config.clone();
7268

7369
if config.level == LoreLogLevel::None {
7470
config.level = LoreLogLevel::Info;
7571
}
7672

73+
lore_base::log::set_log_level(config.level);
74+
75+
if config.file == 0 {
76+
return;
77+
}
78+
7779
let prefix = if !config.file_prefix.is_empty() {
7880
config.file_prefix.to_string()
7981
} else {

0 commit comments

Comments
 (0)