diff OrthancFramework/Sources/Logging.cpp @ 4271:1bd14c900699

LogCategory_PLUGINS
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Nov 2020 07:15:44 +0100
parents 251a8b07fa37
children 1661544ea94d
line wrap: on
line diff
--- a/OrthancFramework/Sources/Logging.cpp	Mon Nov 02 18:45:50 2020 +0100
+++ b/OrthancFramework/Sources/Logging.cpp	Tue Nov 03 07:15:44 2020 +0100
@@ -132,6 +132,10 @@
                             LogCategory category,
                             bool enabled)
     {
+      // Invariant: If a bit is set for "trace", it must also be set
+      // for "verbose" (in other words, trace level implies verbose level)
+      assert((traceCategoriesMask_ & infoCategoriesMask_) == traceCategoriesMask_);
+      
       if (level == LogLevel_INFO)
       {
         if (enabled)
@@ -161,6 +165,8 @@
         throw OrthancException(ErrorCode_ParameterOutOfRange,
                                "Can only modify the parameters of the INFO and TRACE levels");
       }
+
+      assert((traceCategoriesMask_ & infoCategoriesMask_) == traceCategoriesMask_);
     }
 
     
@@ -193,6 +199,10 @@
       {
         return LogCategory_GENERIC;
       }
+      else if (category == "plugins")
+      {
+        return LogCategory_PLUGINS;
+      }
       else if (category == "dicom")
       {
         return LogCategory_DICOM;