comparison Resources/Orthanc/Core/Logging.cpp @ 107:a3e8ac8b7256

support for OpenBSD
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Aug 2017 11:10:48 +0200
parents ff0ef01c332c
children a18bfe1fdd62
comparison
equal deleted inserted replaced
105:42dcf1438943 107:a3e8ac8b7256
89 { 89 {
90 static OrthancPluginContext* context_ = NULL; 90 static OrthancPluginContext* context_ = NULL;
91 91
92 void Initialize(OrthancPluginContext* context) 92 void Initialize(OrthancPluginContext* context)
93 { 93 {
94 context_ = context_; 94 context_ = context;
95 } 95 }
96 96
97 InternalLogger::InternalLogger(const char* level, 97 InternalLogger::InternalLogger(const char* level,
98 const char* file /* ignored */, 98 const char* file /* ignored */,
99 int line /* ignored */) : 99 int line /* ignored */) :
115 } 115 }
116 else if (level_ == "INFO") 116 else if (level_ == "INFO")
117 { 117 {
118 OrthancPluginLogInfo(context_, message_.c_str()); 118 OrthancPluginLogInfo(context_, message_.c_str());
119 } 119 }
120 else
121 {
122 std::string s = "Unknown log level (" + level_ + ") for message: " + message_;
123 OrthancPluginLogError(context_, s.c_str());
124 }
120 } 125 }
121 } 126 }
122 127
123 InternalLogger& InternalLogger::operator<< (const std::string& message) 128 InternalLogger& InternalLogger::operator<< (const std::string& message)
124 { 129 {
154 #include "SystemToolbox.h" 159 #include "SystemToolbox.h"
155 160
156 #include <fstream> 161 #include <fstream>
157 #include <boost/filesystem.hpp> 162 #include <boost/filesystem.hpp>
158 #include <boost/thread.hpp> 163 #include <boost/thread.hpp>
159 164 #include <boost/date_time/posix_time/posix_time.hpp>
160 #if BOOST_HAS_DATE_TIME == 1
161 # include <boost/date_time/posix_time/posix_time.hpp>
162 #else
163 # error Boost::date_time is required
164 #endif
165 165
166 166
167 namespace 167 namespace
168 { 168 {
169 struct LoggingContext 169 struct LoggingContext