diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-07-27 20:10:13 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-07-27 20:10:13 +0000 |
commit | 1736731fbd890fe0d2ef28dab2ee675cb57292d1 (patch) | |
tree | 1326217f351e733828e2aaa356c2a5081d57a0bf /lib/common/Logging.cpp | |
parent | c5d605e27e211dc512e9123b966736baadba6b85 (diff) |
Use the new time function when generating console log messages.
Diffstat (limited to 'lib/common/Logging.cpp')
-rw-r--r-- | lib/common/Logging.cpp | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/lib/common/Logging.cpp b/lib/common/Logging.cpp index 97fc0121..23f760bd 100644 --- a/lib/common/Logging.cpp +++ b/lib/common/Logging.cpp @@ -274,35 +274,8 @@ bool Console::Log(Log::Level level, const std::string& rFile, if (sShowTime) { - box_time_t time_now = GetCurrentBoxTime(); - time_t seconds = BoxTimeToSeconds(time_now); - int micros = BoxTimeToMicroSeconds(time_now) % MICRO_SEC_IN_SEC; - - struct tm tm_now, *tm_ptr = &tm_now; - - #ifdef WIN32 - if ((tm_ptr = localtime(&seconds)) != NULL) - #else - if (localtime_r(&seconds, &tm_now) != NULL) - #endif - { - buf << std::setfill('0') << - std::setw(2) << tm_ptr->tm_hour << ":" << - std::setw(2) << tm_ptr->tm_min << ":" << - std::setw(2) << tm_ptr->tm_sec; - - if (sShowTimeMicros) - { - buf << "." << std::setw(6) << micros; - } - - buf << " "; - } - else - { - buf << strerror(errno); - buf << " "; - } + buf << FormatTime(GetCurrentBoxTime(), sShowTimeMicros); + buf << " "; } if (sShowTag) |