diff options
Diffstat (limited to 'src/logger.cpp')
-rw-r--r-- | src/logger.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/logger.cpp b/src/logger.cpp index 1b8fe04f4..9813ae150 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -29,20 +29,15 @@ static Anope::string GetTimeStamp() { char tbuf[256]; - time_t t; - if (time(&t) < 0) - t = Anope::CurTime; - - tm tm = *localtime(&t); + Anope::UpdateTime(); + auto tm = *localtime(&Anope::CurTime); if (Anope::Debug) { char *s; - struct timeval tv; - gettimeofday(&tv, NULL); strftime(tbuf, sizeof(tbuf) - 1, "[%b %d %H:%M:%S", &tm); s = tbuf + strlen(tbuf); - s += snprintf(s, sizeof(tbuf) - (s - tbuf), ".%06d", static_cast<int>(tv.tv_usec)); + s += snprintf(s, sizeof(tbuf) - (s - tbuf), ".%06lld", static_cast<long long>(Anope::CurTimeNs / 1000)); strftime(s, sizeof(tbuf) - (s - tbuf) - 1, " %Y]", &tm); } else |