From: Marco Zanon Date: Fri, 5 Aug 2022 13:07:09 +0000 (+0000) Subject: Implemented the appendSafeMessage() methods. X-Git-Tag: 7.4.0~1 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=5f6bf5b67d545a83499a6ae8a71cc3596566a1c8;p=Macaco Implemented the appendSafeMessage() methods. --- diff --git a/src/main/java/com/marcozanon/macaco/logging/MLogFilter.java b/src/main/java/com/marcozanon/macaco/logging/MLogFilter.java index 353ec98..182f611 100644 --- a/src/main/java/com/marcozanon/macaco/logging/MLogFilter.java +++ b/src/main/java/com/marcozanon/macaco/logging/MLogFilter.java @@ -94,6 +94,16 @@ public class MLogFilter extends MObject { return this.appendMessage(level, message, 0); } + public boolean appendSafeMessage(MLogFilter.Threshold level, String message) { + try { + return this.appendMessage(level, message); + } + catch (MLoggingException exception) { + } + // + return false; + } + public boolean appendMessage(MLogFilter.Threshold level, String message, int indentation) throws MLoggingException { if (null == level) { throw new IllegalArgumentException("Invalid 'level': null."); @@ -112,6 +122,16 @@ public class MLogFilter extends MObject { return true; } + public boolean appendSafeMessage(MLogFilter.Threshold level, String message, int indentation) { + try { + return this.appendMessage(level, message, indentation); + } + catch (MLoggingException exception) { + } + // + return false; + } + protected void flushMessages() throws MLoggingException { while (0 < this.logMessageQueue.size()) { MLogMessage logMessage = this.logMessageQueue.remove();