Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add small log #891

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ pub fn prepare_message_params (
}

pub fn print_encoded_message(msg: &EncodedMessage, is_json:bool) {
let expire = if msg.expire.is_some() {
let expire_at = Local.timestamp(msg.expire.unwrap() as i64, 0);
expire_at.to_rfc2822()
let (expire, ut) = if let Some(expire) = msg.expire {
let expire_at = Local.timestamp(expire as i64, 0);
(expire_at.to_rfc2822(), format!("{}", expire))
} else {
"unknown".to_string()
("unknown".to_string(), "unknown".to_string())
};
if !is_json {
println!();
println!("MessageId: {}", msg.message_id);
println!("Expire at: {}", expire);
println!("Expire at: {} (unix time: {})", expire, ut);
} else {
println!(" \"MessageId\": \"{}\",", msg.message_id);
println!(" \"Expire at\": \"{}\",", expire);
Expand Down