Modified appendMessage() methods to return a boolean.
authorMarco Zanon <info@marcozanon.com>
Tue, 2 Aug 2022 16:47:16 +0000 (16:47 +0000)
committerMarco Zanon <info@marcozanon.com>
Tue, 2 Aug 2022 16:47:16 +0000 (16:47 +0000)
src/main/java/com/marcozanon/macaco/logging/MLogFilter.java

index c5bfccae4a5f66f8618a820cf1a9a8c4e00ad5b7..353ec983b8d9c6b92739b233d8ad2435a06c2a1e 100644 (file)
@@ -90,17 +90,17 @@ public class MLogFilter extends MObject {
         return this.pausedState;
     }
 
-    public void appendMessage(MLogFilter.Threshold level, String message) throws MLoggingException {
-        this.appendMessage(level, message, 0);
+    public boolean appendMessage(MLogFilter.Threshold level, String message) throws MLoggingException {
+        return this.appendMessage(level, message, 0);
     }
 
-    public void appendMessage(MLogFilter.Threshold level, String message, int indentation) throws MLoggingException {
+    public boolean appendMessage(MLogFilter.Threshold level, String message, int indentation) throws MLoggingException {
         if (null == level) {
             throw new IllegalArgumentException("Invalid 'level': null.");
         }
         //
         if (level.ordinal() > this.getThreshold().ordinal()) {
-            return;
+            return false;
         }
         //
         this.logMessageQueue.add(new MLogMessage(message, indentation));
@@ -108,6 +108,8 @@ public class MLogFilter extends MObject {
         if (!this.getPausedState()) {
             this.flushMessages();
         }
+        //
+        return true;
     }
 
     protected void flushMessages() throws MLoggingException {