summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/logTargets.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/logTargets.cpp b/src/logTargets.cpp
index 9a07309..898340b 100644
--- a/src/logTargets.cpp
+++ b/src/logTargets.cpp
@@ -44,6 +44,8 @@
#include <strsafe.h>
#endif
+#include <boost/date_time/posix_time/posix_time.hpp>
+
LogTarget::LogTarget() : opened(false), enabled(false), max_prio(Log::PRIO_NOTICE)
{
}
@@ -326,7 +328,7 @@ void LogTargetFile::log(std::string msg, int prio)
if(!opened)
return;
- logfile << Log::prioToString(prio) << ": " << msg << std::endl;
+ logfile << boost::posix_time::second_clock::local_time() << " " << Log::prioToString(prio) << ": " << msg << std::endl;
}
LogTargetFile& LogTargetFile::setLogFilename(std::string l)
@@ -366,7 +368,7 @@ void LogTargetStdout::log(std::string msg, int prio)
if(!opened)
return;
- stream << "LOG-" << Log::prioToString(prio) << ": " << msg << std::endl;
+ stream << boost::posix_time::second_clock::local_time() << " " << Log::prioToString(prio) << ": " << msg << std::endl;
}
#endif