diff OrthancFramework/Sources/Logging.h @ 5571:addccb1590d2

simplifying Orthanc::Logging
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 Apr 2024 14:48:11 +0200
parents 0b18690c1935
children d7eaa568da15
line wrap: on
line diff
--- a/OrthancFramework/Sources/Logging.h	Thu Apr 25 17:16:51 2024 +0200
+++ b/OrthancFramework/Sources/Logging.h	Fri Apr 26 14:48:11 2024 +0200
@@ -181,15 +181,22 @@
 
 #  define LOG(level)     ::Orthanc::Logging::InternalLogger             \
   (::Orthanc::Logging::LogLevel_ ## level,                              \
-   ::Orthanc::Logging::LogCategory_GENERIC, __ORTHANC_FILE__, __LINE__)
+   ::Orthanc::Logging::LogCategory_GENERIC, NULL /* no plugin */,       \
+   __ORTHANC_FILE__, __LINE__)
+
 #  define VLOG(unused)   ::Orthanc::Logging::InternalLogger             \
   (::Orthanc::Logging::LogLevel_TRACE,                                  \
-   ::Orthanc::Logging::LogCategory_GENERIC, __ORTHANC_FILE__, __LINE__)
+   ::Orthanc::Logging::LogCategory_GENERIC, NULL /* no plugin */,       \
+   __ORTHANC_FILE__, __LINE__)
+
 #  define CLOG(level, category) ::Orthanc::Logging::InternalLogger      \
   (::Orthanc::Logging::LogLevel_ ## level,                              \
-   ::Orthanc::Logging::LogCategory_ ## category, __ORTHANC_FILE__, __LINE__)
-#  define LOG_FROM_PLUGIN(level, category, pluginName, file, line)  ::Orthanc::Logging::InternalLogger      \
-  (level, category, pluginName, file, line)
+   ::Orthanc::Logging::LogCategory_ ## category, NULL /* no plugin */,  \
+   __ORTHANC_FILE__, __LINE__)
+
+#  define LOG_FROM_PLUGIN(level, category, pluginName, file, line)      \
+  ::Orthanc::Logging::InternalLogger(level, category, pluginName, file, line)
+
 #endif
 
 
@@ -270,28 +277,13 @@
       const char*                         file_;
       uint32_t                            line_;
 
-      void Setup(LogCategory category,
-                 const char* pluginName,
-                 const char* file,
-                 int line);
-
     public:
       InternalLogger(LogLevel level,
                      LogCategory category,
-                     const char* file,
-                     int line);
-
-      InternalLogger(LogLevel level,
-                     LogCategory category,
                      const char* pluginName,
                      const char* file,
                      int line);
 
-      // For backward binary compatibility with Orthanc Framework <= 1.8.0
-      InternalLogger(LogLevel level,
-                     const char* file,
-                     int line);
-
       ~InternalLogger();
       
       template <typename T>