diff OrthancFramework/Sources/Logging.cpp @ 4268:0ae2ca210077

new macro TLOG() to replace VLOG() for trace logs with a category
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Nov 2020 14:48:15 +0100
parents bf7b9edf6b81
children c7bd2f21ccc3
line wrap: on
line diff
--- a/OrthancFramework/Sources/Logging.cpp	Sun Nov 01 12:43:18 2020 +0100
+++ b/OrthancFramework/Sources/Logging.cpp	Mon Nov 02 14:48:15 2020 +0100
@@ -221,6 +221,7 @@
           break;
 
         case LogLevel_TRACE:
+          // TODO - Check trace category
           if (traceEnabled_)
           {
             TraceLogFunc(message.c_str());
@@ -643,10 +644,12 @@
 
 
     InternalLogger::InternalLogger(LogLevel level,
+                                   TraceCategory category,
                                    const char* file,
                                    int line) : 
       lock_(loggingStreamsMutex_, boost::defer_lock_t()),
       level_(level),
+      category_(category),
       stream_(&nullStream_)  // By default, logging to "/dev/null" is simulated
     {
       if (pluginContext_ != NULL)
@@ -670,7 +673,7 @@
         // We are logging in a standalone application, not inside an Orthanc plugin
 
         if ((level == LogLevel_INFO  && !infoEnabled_) ||
-            (level == LogLevel_TRACE && !traceEnabled_))
+            (level == LogLevel_TRACE && !traceEnabled_))     // TODO - Check trace category
         {
           // This logging level is disabled, directly exit as the
           // stream is set to "/dev/null"