summaryrefslogtreecommitdiff
path: root/src/logTargets.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-05-03 19:40:29 +0000
committerChristian Pointner <equinox@anytun.org>2009-05-03 19:40:29 +0000
commit6ae9c6ee6a5c08a6bbf3861f2a1fa26b5dbbcf5a (patch)
tree965f9ae2cbea2b075b60acf15cae7191b256ddf5 /src/logTargets.cpp
parentstarting post up script in seperate thread (diff)
added timestap to stdout, stderr and file log message
Diffstat (limited to 'src/logTargets.cpp')
-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