From: Marco Zanon Date: Fri, 5 Aug 2022 13:07:09 +0000 (+0000) Subject: Implemented the appendSafeMessage() methods. X-Git-Tag: SVN-to-Git~31 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=955f6c9333006a178aa2ad766f3927eb58d06e40;p=Macaco Implemented the appendSafeMessage() methods. --- diff --git a/7.x/src/main/java/com/marcozanon/macaco/logging/MLogFilter.java b/7.x/src/main/java/com/marcozanon/macaco/logging/MLogFilter.java index 353ec98..182f611 100644 --- a/7.x/src/main/java/com/marcozanon/macaco/logging/MLogFilter.java +++ b/7.x/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();