projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
std::shared_ptr
[dcpomatic.git]
/
src
/
lib
/
file_log.cc
diff --git
a/src/lib/file_log.cc
b/src/lib/file_log.cc
index c2a33d4252b3a7a582fa2ae1c45a48508e1c270d..481624c2a865136f3cc3aac83b6dc64663efe661 100644
(file)
--- a/
src/lib/file_log.cc
+++ b/
src/lib/file_log.cc
@@
-20,19
+20,27
@@
#include "file_log.h"
#include "cross.h"
#include "file_log.h"
#include "cross.h"
+#include "config.h"
#include <cstdio>
#include <iostream>
#include <cstdio>
#include <iostream>
+#include <cerrno>
using std::cout;
using std::string;
using std::max;
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)
: _file (file)
{
/** @param file Filename to write log to */
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
}
void
@@
-40,7
+48,7
@@
FileLog::do_log (shared_ptr<const LogEntry> entry)
{
FILE* f = fopen_boost (_file, "a");
if (!f) {
{
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;
}
return;
}