Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit d0e68bf

Browse files
bkchrrphmeier
authored andcommitted
Don't panic when we try to register 2 global loggers (#3840)
1 parent df1582b commit d0e68bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/cli/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,9 @@ fn init_logger(pattern: &str) {
919919
writeln!(buf, "{}", output)
920920
});
921921

922-
builder.init();
922+
if builder.try_init().is_err() {
923+
info!("Not registering Substrate logger, as there is already a global logger registered!");
924+
}
923925
}
924926

925927
fn kill_color(s: &str) -> String {

0 commit comments

Comments
 (0)