diff OrthancServer/main.cpp @ 1866:579bf74f7da1

output creation time for mainline builds
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 03 Dec 2015 10:02:16 +0100
parents d364926389e0
children 9af3b492b010 e8146c9c28a4
line wrap: on
line diff
--- a/OrthancServer/main.cpp	Wed Dec 02 16:05:31 2015 +0100
+++ b/OrthancServer/main.cpp	Thu Dec 03 10:02:16 2015 +0100
@@ -1099,7 +1099,25 @@
    * Launch Orthanc.
    **/
 
-  LOG(WARNING) << "Orthanc version: " << ORTHANC_VERSION;
+  {
+    std::string version(ORTHANC_VERSION);
+
+    if (std::string(ORTHANC_VERSION) == "mainline")
+    {
+      try
+      {
+        boost::filesystem::path exe(Toolbox::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 version: " << version;
+  }
 
   int status = 0;
   try