diff options
Diffstat (limited to 'src/logTargets.cpp')
-rw-r--r-- | src/logTargets.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/logTargets.cpp b/src/logTargets.cpp index 898340b..4420f1d 100644 --- a/src/logTargets.cpp +++ b/src/logTargets.cpp @@ -328,7 +328,8 @@ void LogTargetFile::log(std::string msg, int prio) if(!opened) return; - logfile << boost::posix_time::second_clock::local_time() << " " << Log::prioToString(prio) << ": " << msg << std::endl; + std::string timestamp = boost::posix_time::to_simple_string(boost::posix_time::second_clock::local_time()); + logfile << timestamp << " " << Log::prioToString(prio) << ": " << msg << std::endl; } LogTargetFile& LogTargetFile::setLogFilename(std::string l) @@ -368,7 +369,8 @@ void LogTargetStdout::log(std::string msg, int prio) if(!opened) return; - stream << boost::posix_time::second_clock::local_time() << " " << Log::prioToString(prio) << ": " << msg << std::endl; + std::string timestamp = boost::posix_time::to_simple_string(boost::posix_time::second_clock::local_time()); + stream << timestamp << " " << Log::prioToString(prio) << ": " << msg << std::endl; } #endif |