changeset 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 ed7dd49aa777
children 769178f0ab2c
files OrthancServer/main.cpp
diffstat 1 files changed, 19 insertions(+), 1 deletions(-) [+]
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