mirror of
https://codeberg.org/icewind/logsmash.git
synced 2026-06-03 18:14:11 +02:00
fix displaying patterns
This commit is contained in:
parent
bce2ba3bf5
commit
cbb9cbabdd
1 changed files with 3 additions and 3 deletions
|
|
@ -157,9 +157,9 @@ struct LoggingStatementMessage {
|
||||||
impl Display for LoggingStatementMessage {
|
impl Display for LoggingStatementMessage {
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||||
if let Some(exception) = self.exception {
|
if let Some(exception) = self.exception {
|
||||||
write!(f, "«{}({})»", exception, self.message)
|
write!(f, "{}({})", exception, self.message)
|
||||||
} else {
|
} else {
|
||||||
write!(f, "«{}»", self.message)
|
write!(f, "{}", self.message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -186,7 +186,7 @@ impl Display for LoggingMessage {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
let mut placeholder_index = 0;
|
let mut placeholder_index = 0;
|
||||||
for part in self.message.pattern.split('\0') {
|
for part in self.message.pattern.trim_end_matches('\x01').split('\0') {
|
||||||
write!(f, "{part}")?;
|
write!(f, "{part}")?;
|
||||||
if let Some(placeholder) = self.message.placeholders.get(placeholder_index) {
|
if let Some(placeholder) = self.message.placeholders.get(placeholder_index) {
|
||||||
write!(f, "{placeholder}")?;
|
write!(f, "{placeholder}")?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue