fixed output when details is empty #579

This commit is contained in:
DustInDark
2022-06-10 17:57:39 +09:00
parent bd03e2a7ff
commit eda1da81e9

View File

@@ -251,12 +251,18 @@ fn emit_csv<W: std::io::Write>(
.record_information
.as_ref()
.map(|recinfo| _format_cellpos(recinfo, ColPos::Last));
let details = detect_info
let ctr_char_exclude_details = detect_info
.detail
.chars()
.filter(|&c| !c.is_control())
.collect::<String>();
let details = if ctr_char_exclude_details.is_empty() {
"-".to_string()
} else {
ctr_char_exclude_details
};
let dispformat: _ = DisplayFormat {
timestamp: &_format_cellpos(&time_str, ColPos::First),
level: &_format_cellpos(level_abbr.get(&level).unwrap_or(&level), ColPos::Other),