mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 23:06:32 +03:00
Log messages in info!() if DCC_MIME_DEBUG is set
Using println!() leads to reordered output on terminal. Moreover, println!() prints to stdout which is not for logging.
This commit is contained in:
@@ -722,9 +722,11 @@ impl<'a> MimeFactory<'a> {
|
||||
));
|
||||
|
||||
if std::env::var(crate::DCC_MIME_DEBUG).is_ok() {
|
||||
info!(context, "mimefactory: outgoing message mime:");
|
||||
let raw_message = message.clone().build().as_string();
|
||||
println!("{}", raw_message);
|
||||
info!(
|
||||
context,
|
||||
"mimefactory: unencrypted message mime-body:\n{}",
|
||||
message.clone().build().as_string(),
|
||||
);
|
||||
}
|
||||
|
||||
let encrypted = encrypt_helper
|
||||
@@ -782,6 +784,14 @@ impl<'a> MimeFactory<'a> {
|
||||
.into_iter()
|
||||
.fold(outer_message, |message, header| message.header(header));
|
||||
|
||||
if std::env::var(crate::DCC_MIME_DEBUG).is_ok() {
|
||||
info!(
|
||||
context,
|
||||
"mimefactory: outgoing message mime-body:\n{}",
|
||||
outer_message.clone().build().as_string(),
|
||||
);
|
||||
}
|
||||
|
||||
let MimeFactory {
|
||||
last_added_location_id,
|
||||
..
|
||||
|
||||
Reference in New Issue
Block a user