X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffile_log.cc;h=481624c2a865136f3cc3aac83b6dc64663efe661;hb=6c092a6abef4bf38fe62112544f7b6247cdb07d0;hp=f6eaa58f8ebaf85b4e02630fee9ab869f91115c2;hpb=a5be11a965c2c38442e4e069874e7e21b5b43a5c;p=dcpomatic.git diff --git a/src/lib/file_log.cc b/src/lib/file_log.cc index f6eaa58f8..481624c2a 100644 --- a/src/lib/file_log.cc +++ b/src/lib/file_log.cc @@ -23,11 +23,12 @@ #include "config.h" #include #include +#include using std::cout; using std::string; using std::max; -using boost::shared_ptr; +using std::shared_ptr; /** @param file Filename to write log to */ FileLog::FileLog (boost::filesystem::path file) @@ -36,12 +37,18 @@ FileLog::FileLog (boost::filesystem::path file) set_types (Config::instance()->log_types()); } +FileLog::FileLog (boost::filesystem::path file, int types) + : _file (file) +{ + set_types (types); +} + void 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; }