diff Core/Logging.h @ 2484:911e62dbb4ac

logging to stdio
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 02 Mar 2018 18:25:07 +0100
parents 9c54c40eaf25
children 78862372ea88
line wrap: on
line diff
--- a/Core/Logging.h	Fri Mar 02 15:10:37 2018 +0100
+++ b/Core/Logging.h	Fri Mar 02 18:25:07 2018 +0100
@@ -116,6 +116,7 @@
        ORTHANC_ENABLE_LOGGING_STDIO == 1)
 
 #  include <boost/noncopyable.hpp>
+#  include <boost/lexical_cast.hpp>
 #  define LOG(level)  ::Orthanc::Logging::InternalLogger \
   (::Orthanc::Logging::level, __FILE__, __LINE__)
 #  define VLOG(level) ::Orthanc::Logging::InternalLogger \
@@ -146,11 +147,12 @@
 
       ~InternalLogger();
       
-      InternalLogger& operator<< (const std::string& message);
-
-      InternalLogger& operator<< (const char* message);
-
-      InternalLogger& operator<< (int message);
+      template <typename T>
+      InternalLogger& operator<< (T message)
+      {
+        message_ += boost::lexical_cast<std::string>(message);
+        return *this;
+      }
     };
   }
 }