X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffile_log.cc;h=b9aa84c3d9ff2aa957f84f01714fb1cbc1def2f9;hb=001ba1644fc6aa54f91fcaaa62ae7e5de2313bc1;hp=c2a33d4252b3a7a582fa2ae1c45a48508e1c270d;hpb=3828baf56467224f5d44049bf1e7a7ed11f43a05;p=dcpomatic.git diff --git a/src/lib/file_log.cc b/src/lib/file_log.cc index c2a33d425..b9aa84c3d 100644 --- a/src/lib/file_log.cc +++ b/src/lib/file_log.cc @@ -20,8 +20,10 @@ #include "file_log.h" #include "cross.h" +#include "config.h" #include #include +#include using std::cout; using std::string; @@ -32,7 +34,13 @@ using boost::shared_ptr; FileLog::FileLog (boost::filesystem::path file) : _file (file) { + set_types (Config::instance()->log_types()); +} +FileLog::FileLog (boost::filesystem::path file, int types) + : _file (file) +{ + set_types (types); } void @@ -40,7 +48,7 @@ FileLog::do_log (shared_ptr entry) { FILE* f = fopen_boost (_file, "a"); if (!f) { - cout << "(could not log to " << _file.string() << "): " << entry.get() << "\n"; + cout << "(could not log to " << _file.string() << " error " << errno << "): " << entry->get() << "\n"; return; }