# HG changeset patch # User Sebastien Jodogne # Date 1482508163 -3600 # Node ID 14146ecd16881b7ddadd9ff234c00380cf7d5982 # Parent 4b0e0f7c99571bb77a9364ef2cf082cf0b4165f0 Display version of the framework in the logs diff -r 4b0e0f7c9957 -r 14146ecd1688 Applications/ApplicationToolbox.cpp --- a/Applications/ApplicationToolbox.cpp Fri Dec 23 16:06:05 2016 +0100 +++ b/Applications/ApplicationToolbox.cpp Fri Dec 23 16:49:23 2016 +0100 @@ -24,10 +24,13 @@ #include "../Resources/Orthanc/Core/HttpClient.h" #include "../Resources/Orthanc/Core/Logging.h" #include "../Resources/Orthanc/Core/MultiThreading/BagOfTasksProcessor.h" +#include "../Resources/Orthanc/Core/SystemToolbox.h" #include "../Resources/Orthanc/OrthancServer/FromDcmtkBridge.h" +#include #include #include +#include #include @@ -202,5 +205,27 @@ << std::endl << "Written by Sebastien Jodogne " << std::endl; } + + + void ShowVersionInLog(const char* path) + { + std::string version(ORTHANC_WSI_VERSION); + + if (version == "mainline") + { + try + { + boost::filesystem::path exe(Orthanc::SystemToolbox::GetPathToExecutable()); + std::time_t creation = boost::filesystem::last_write_time(exe); + boost::posix_time::ptime converted(boost::posix_time::from_time_t(creation)); + version += " (" + boost::posix_time::to_iso_string(converted) + ")"; + } + catch (...) + { + } + } + + LOG(WARNING) << "Orthanc WSI version: " << version; + } } } diff -r 4b0e0f7c9957 -r 14146ecd1688 Applications/ApplicationToolbox.h --- a/Applications/ApplicationToolbox.h Fri Dec 23 16:06:05 2016 +0100 +++ b/Applications/ApplicationToolbox.h Fri Dec 23 16:49:23 2016 +0100 @@ -42,5 +42,7 @@ const std::string& color); void PrintVersion(const char* path); + + void ShowVersionInLog(const char* path); } } diff -r 4b0e0f7c9957 -r 14146ecd1688 Applications/DicomToTiff.cpp --- a/Applications/DicomToTiff.cpp Fri Dec 23 16:06:05 2016 +0100 +++ b/Applications/DicomToTiff.cpp Fri Dec 23 16:49:23 2016 +0100 @@ -274,6 +274,7 @@ int main(int argc, char* argv[]) { OrthancWSI::ApplicationToolbox::GlobalInitialize(); + OrthancWSI::ApplicationToolbox::ShowVersionInLog(argv[0]); int exitStatus = 0; boost::program_options::variables_map options; diff -r 4b0e0f7c9957 -r 14146ecd1688 Applications/Dicomizer.cpp --- a/Applications/Dicomizer.cpp Fri Dec 23 16:06:05 2016 +0100 +++ b/Applications/Dicomizer.cpp Fri Dec 23 16:49:23 2016 +0100 @@ -876,6 +876,7 @@ int main(int argc, char* argv[]) { OrthancWSI::ApplicationToolbox::GlobalInitialize(); + OrthancWSI::ApplicationToolbox::ShowVersionInLog(argv[0]); int exitStatus = 0; diff -r 4b0e0f7c9957 -r 14146ecd1688 NEWS --- a/NEWS Fri Dec 23 16:06:05 2016 +0100 +++ b/NEWS Fri Dec 23 16:49:23 2016 +0100 @@ -4,6 +4,8 @@ * Thanks to David Clunie's feedback: - Fix generation of tag "Dimension Index Sequence" (0020,9222) - Fix generation of tag "Dimension Index Values" (0020,9157) +* Improved logging in the viewer plugin +* Display version of the framework in the logs Version 0.2 (2016/11/28)