summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-12-04 22:11:10 +0000
committerCarl Hetherington <cth@carlh.net>2015-12-04 22:11:10 +0000
commit81f361a0da4eef3ce83d003204042104d5555d39 (patch)
tree2c858578ccc80c92c034b858cbb0d15064cbc5f1 /src/lib
parent7fc0f6e56c25f01b3bc42f8b5f8d3cf5935bb875 (diff)
Ensure basic system information is in problem reports.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/environment_info.cc30
-rw-r--r--src/lib/environment_info.h2
-rw-r--r--src/lib/film.cc4
-rw-r--r--src/lib/send_problem_report_job.cc8
4 files changed, 29 insertions, 15 deletions
diff --git a/src/lib/environment_info.cc b/src/lib/environment_info.cc
index f8d0a75d1..da34d5a9a 100644
--- a/src/lib/environment_info.cc
+++ b/src/lib/environment_info.cc
@@ -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;
}
diff --git a/src/lib/environment_info.h b/src/lib/environment_info.h
index 7cd541bfc..e8a626954 100644
--- a/src/lib/environment_info.h
+++ b/src/lib/environment_info.h
@@ -17,4 +17,4 @@
*/
-extern void environment_info (boost::shared_ptr<Log> log);
+extern std::list<std::string> environment_info ();
diff --git a/src/lib/film.cc b/src/lib/film.cc
index b27a0b0e4..8c12e7080 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -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());
diff --git a/src/lib/send_problem_report_job.cc b/src/lib/send_problem_report_job.cc
index 139bdb81c..89fe2a715 100644
--- a/src/lib/send_problem_report_job.cc
+++ b/src/lib/send_problem_report_job.cc
@@ -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";