Ensure basic system information is in problem reports.
authorCarl Hetherington <cth@carlh.net>
Fri, 4 Dec 2015 22:11:10 +0000 (22:11 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 4 Dec 2015 22:11:10 +0000 (22:11 +0000)
src/lib/environment_info.cc
src/lib/environment_info.h
src/lib/film.cc
src/lib/send_problem_report_job.cc

index f8d0a75d13e13dbd112d80909e5528f2b13299a6..da34d5a9aff3486dc190966d46c1753a2ed9c9ce 100644 (file)
@@ -80,46 +80,50 @@ dependency_version_summary ()
        return s.str ();
 }
 
-void
-environment_info (shared_ptr<Log> log)
+list<string>
+environment_info ()
 {
-       LOG_GENERAL ("DCP-o-matic %1 git %2 using %3", dcpomatic_version, dcpomatic_git_commit, dependency_version_summary());
+       list<string> info;
+
+       info.push_back (String::compose ("DCP-o-matic %1 git %2 using %3", dcpomatic_version, dcpomatic_git_commit, dependency_version_summary()));
 
        {
                char buffer[128];
                gethostname (buffer, sizeof (buffer));
-               LOG_GENERAL ("Host name %1", buffer);
+               info.push_back (String::compose ("Host name %1", buffer));
        }
 
 #ifdef DCPOMATIC_DEBUG
-       LOG_GENERAL_NC ("DCP-o-matic built in debug mode.");
+       info.push_back ("DCP-o-matic built in debug mode.");
 #else
-       LOG_GENERAL_NC ("DCP-o-matic built in optimised mode.");
+       info.push_back ("DCP-o-matic built in optimised mode.");
 #endif
 #ifdef LIBDCP_DEBUG
-       LOG_GENERAL_NC ("libdcp built in debug mode.");
+       info.push_back ("libdcp built in debug mode.");
 #else
-       LOG_GENERAL_NC ("libdcp built in optimised mode.");
+       info.push_back ("libdcp built in optimised mode.");
 #endif
 
 #ifdef DCPOMATIC_WINDOWS
        OSVERSIONINFO info;
        info.dwOSVersionInfoSize = sizeof (info);
        GetVersionEx (&info);
-       LOG_GENERAL ("Windows version %1.%2.%3 SP %4", info.dwMajorVersion, info.dwMinorVersion, info.dwBuildNumber, info.szCSDVersion);
+       info.push_back (String::compose ("Windows version %1.%2.%3 SP %4", info.dwMajorVersion, info.dwMinorVersion, info.dwBuildNumber, info.szCSDVersion));
 #endif
 
 #if __GNUC__
 #if __x86_64__
-       LOG_GENERAL_NC ("Built for 64-bit");
+       info.push_back ("Built for 64-bit");
 #else
-       LOG_GENERAL_NC ("Built for 32-bit");
+       info.push_back ("Built for 32-bit");
 #endif
 #endif
 
-       LOG_GENERAL ("CPU: %1, %2 processors", cpu_info(), boost::thread::hardware_concurrency ());
+       info.push_back (String::compose ("CPU: %1, %2 processors", cpu_info(), boost::thread::hardware_concurrency ()));
        list<pair<string, string> > const m = mount_info ();
        for (list<pair<string, string> >::const_iterator i = m.begin(); i != m.end(); ++i) {
-               LOG_GENERAL ("Mount: %1 %2", i->first, i->second);
+               info.push_back (String::compose ("Mount: %1 %2", i->first, i->second));
        }
+
+       return info;
 }
index 7cd541bfc7552ed765632214d0427b405f947d05..e8a6269549a4564eaf049964397069e365fe3018 100644 (file)
@@ -17,4 +17,4 @@
 
 */
 
-extern void environment_info (boost::shared_ptr<Log> log);
+extern std::list<std::string> environment_info ();
index b27a0b0e481260ca96c2e8e6a4a95b1a697954b3..8c12e70809de314159f7786ce46f973455366b3c 100644 (file)
@@ -274,7 +274,9 @@ Film::make_dcp ()
 
        set_isdcf_date_today ();
 
-       environment_info (log ());
+       BOOST_FOREACH (string i, environment_info ()) {
+               LOG_GENERAL_NC (i);
+       }
 
        BOOST_FOREACH (shared_ptr<const Content> i, content ()) {
                LOG_GENERAL ("Content: %1", i->technical_summary());
index 139bdb81c7279580ce6f9860a9d0860eaac26a32..89fe2a715843f63f35e0f6205f56a455b453c04c 100644 (file)
@@ -25,6 +25,8 @@
 #include "log.h"
 #include "version.h"
 #include "emailer.h"
+#include "environment_info.h"
+#include <boost/foreach.hpp>
 
 #include "i18n.h"
 
@@ -71,6 +73,12 @@ SendProblemReportJob::run ()
 
        body += "Version: " + string (dcpomatic_version) + " " + string (dcpomatic_git_commit) + "\n\n";
 
+       BOOST_FOREACH (string i, environment_info ()) {
+               body += i + "\n";
+       }
+
+       body += "\n";
+
        if (_film) {
                body += "log head and tail:\n";
                body += "---<8----\n";