diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-03-16 00:44:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-06 15:57:14 +0200 |
| commit | a1f7bf2d9e5610075fbd898cdf52f4f8373741f2 (patch) | |
| tree | 5539cea37bebe3347408b9404ac3d9aa5cd5fe1b /src/lib/file_log.cc | |
| parent | adddda49c17e87198253d9c900dcef0f5fb2e175 (diff) | |
Add disk writer tool.
Diffstat (limited to 'src/lib/file_log.cc')
| -rw-r--r-- | src/lib/file_log.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/file_log.cc b/src/lib/file_log.cc index f6eaa58f8..b9aa84c3d 100644 --- a/src/lib/file_log.cc +++ b/src/lib/file_log.cc @@ -23,6 +23,7 @@ #include "config.h" #include <cstdio> #include <iostream> +#include <cerrno> using std::cout; using std::string; @@ -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<const LogEntry> 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; } |
