Mercurial > hg > orthanc-wsi
comparison Applications/ApplicationToolbox.cpp @ 93:14146ecd1688
Display version of the framework in the logs
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 23 Dec 2016 16:49:23 +0100 |
parents | 3d83d34cd4db |
children | ff0ef01c332c |
comparison
equal
deleted
inserted
replaced
92:4b0e0f7c9957 | 93:14146ecd1688 |
---|---|
22 | 22 |
23 #include "../Framework/Inputs/OpenSlideLibrary.h" | 23 #include "../Framework/Inputs/OpenSlideLibrary.h" |
24 #include "../Resources/Orthanc/Core/HttpClient.h" | 24 #include "../Resources/Orthanc/Core/HttpClient.h" |
25 #include "../Resources/Orthanc/Core/Logging.h" | 25 #include "../Resources/Orthanc/Core/Logging.h" |
26 #include "../Resources/Orthanc/Core/MultiThreading/BagOfTasksProcessor.h" | 26 #include "../Resources/Orthanc/Core/MultiThreading/BagOfTasksProcessor.h" |
27 #include "../Resources/Orthanc/Core/SystemToolbox.h" | |
27 #include "../Resources/Orthanc/OrthancServer/FromDcmtkBridge.h" | 28 #include "../Resources/Orthanc/OrthancServer/FromDcmtkBridge.h" |
28 | 29 |
30 #include <boost/filesystem.hpp> | |
29 #include <boost/lexical_cast.hpp> | 31 #include <boost/lexical_cast.hpp> |
30 #include <boost/regex.hpp> | 32 #include <boost/regex.hpp> |
33 #include <boost/date_time/posix_time/posix_time.hpp> | |
31 #include <cassert> | 34 #include <cassert> |
32 | 35 |
33 | 36 |
34 static bool DisplayPerformanceWarning() | 37 static bool DisplayPerformanceWarning() |
35 { | 38 { |
200 << "This is free software: you are free to change and redistribute it." << std::endl | 203 << "This is free software: you are free to change and redistribute it." << std::endl |
201 << "There is NO WARRANTY, to the extent permitted by law." << std::endl | 204 << "There is NO WARRANTY, to the extent permitted by law." << std::endl |
202 << std::endl | 205 << std::endl |
203 << "Written by Sebastien Jodogne <s.jodogne@gmail.com>" << std::endl; | 206 << "Written by Sebastien Jodogne <s.jodogne@gmail.com>" << std::endl; |
204 } | 207 } |
208 | |
209 | |
210 void ShowVersionInLog(const char* path) | |
211 { | |
212 std::string version(ORTHANC_WSI_VERSION); | |
213 | |
214 if (version == "mainline") | |
215 { | |
216 try | |
217 { | |
218 boost::filesystem::path exe(Orthanc::SystemToolbox::GetPathToExecutable()); | |
219 std::time_t creation = boost::filesystem::last_write_time(exe); | |
220 boost::posix_time::ptime converted(boost::posix_time::from_time_t(creation)); | |
221 version += " (" + boost::posix_time::to_iso_string(converted) + ")"; | |
222 } | |
223 catch (...) | |
224 { | |
225 } | |
226 } | |
227 | |
228 LOG(WARNING) << "Orthanc WSI version: " << version; | |
229 } | |
205 } | 230 } |
206 } | 231 } |