projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pot/merge.
[dcpomatic.git]
/
src
/
lib
/
file_log.cc
diff --git
a/src/lib/file_log.cc
b/src/lib/file_log.cc
index be532c10fb648adab268b13c6d3c2401b5d72aae..b9aa84c3d9ff2aa957f84f01714fb1cbc1def2f9 100644
(file)
--- a/
src/lib/file_log.cc
+++ b/
src/lib/file_log.cc
@@
-23,6
+23,7
@@
#include "config.h"
#include <cstdio>
#include <iostream>
#include "config.h"
#include <cstdio>
#include <iostream>
+#include <cerrno>
using std::cout;
using std::string;
using std::cout;
using std::string;
@@
-33,14
+34,13
@@
using boost::shared_ptr;
FileLog::FileLog (boost::filesystem::path file)
: _file (file)
{
FileLog::FileLog (boost::filesystem::path file)
: _file (file)
{
- _config_connection = Config::instance()->Changed.connect (boost::bind (&FileLog::config_changed, this));
- config_changed ();
+ set_types (Config::instance()->log_types());
}
}
-void
-
FileLog::config_changed (
)
+FileLog::FileLog (boost::filesystem::path file, int types)
+
: _file (file
)
{
{
- set_types (
Config::instance()->log_types ()
);
+ set_types (
types
);
}
void
}
void
@@
-48,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;
}