aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mumd/src/main.rs')
-rw-r--r--mumd/src/main.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/mumd/src/main.rs b/mumd/src/main.rs
index 24c2567..a2665ba 100644
--- a/mumd/src/main.rs
+++ b/mumd/src/main.rs
@@ -23,11 +23,11 @@ use tokio::sync::{mpsc, watch};
#[tokio::main]
async fn main() {
// setup logger
- //TODO? add newline before message if it contains newlines
fern::Dispatch::new()
.format(|out, message, record| {
+ let message = message.to_string();
out.finish(format_args!(
- "{} {}:{} {}",
+ "{} {}:{}{}{}",
//TODO runtime flag that disables color
match record.level() {
Level::Error => "ERROR".red(),
@@ -38,6 +38,7 @@ async fn main() {
},
record.file().unwrap(),
record.line().unwrap(),
+ if message.chars().any(|e| e == '\n') { "\n" } else { " " },
message
))
})