diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-10-09 13:44:10 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-10-09 13:45:12 +0100 |
| commit | aeb835a18c8df347e0ed68fb24631b320abeb611 (patch) | |
| tree | 01746a2d872aad8127a1442326ac720756172a17 /src/lib/file_log.cc | |
| parent | 4d9f56686380aed5eb3e17ab9e720df57a17f079 (diff) | |
Logging improvements to allow prettier displays in the server GUI.
Diffstat (limited to 'src/lib/file_log.cc')
| -rw-r--r-- | src/lib/file_log.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/file_log.cc b/src/lib/file_log.cc index b3c9797c9..1557bbd94 100644 --- a/src/lib/file_log.cc +++ b/src/lib/file_log.cc @@ -25,6 +25,7 @@ using std::cout; using std::string; using std::max; +using boost::shared_ptr; /** @param file Filename to write log to */ FileLog::FileLog (boost::filesystem::path file) @@ -34,15 +35,15 @@ FileLog::FileLog (boost::filesystem::path file) } void -FileLog::do_log (string m) +FileLog::do_log (shared_ptr<const LogEntry> entry) { FILE* f = fopen_boost (_file, "a"); if (!f) { - cout << "(could not log to " << _file.string() << "): " << m << "\n"; + cout << "(could not log to " << _file.string() << "): " << entry.get() << "\n"; return; } - fprintf (f, "%s\n", m.c_str ()); + fprintf (f, "%s\n", entry->get().c_str ()); fclose (f); } |
