From 951e35e493c9dbd6b1f62ef9448a39f6b6fa63de Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 4 Aug 2020 01:39:52 +0300 Subject: [PATCH] Minor logging speed up. GitOrigin-RevId: a6c514665465d3527123a3847790a77e61ce534a --- tdutils/td/utils/logging.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tdutils/td/utils/logging.cpp b/tdutils/td/utils/logging.cpp index c2a771bc9..46a5dbc60 100644 --- a/tdutils/td/utils/logging.cpp +++ b/tdutils/td/utils/logging.cpp @@ -75,10 +75,10 @@ Logger::Logger(LogInterface &log, const LogOptions &options, int log_level, Slic // timestamp auto time = Clocks::system(); - auto unix_time = static_cast(time); - auto nanoseconds = static_cast((time - unix_time) * 1e9); + auto unix_time = static_cast(time); + auto nanoseconds = static_cast((time - unix_time) * 1e9); sb_ << '[' << unix_time << '.'; - auto limit = 100000000; + uint32 limit = 100000000; while (nanoseconds < limit && limit > 1) { sb_ << '0'; limit /= 10; @@ -92,7 +92,7 @@ Logger::Logger(LogInterface &log, const LogOptions &options, int log_level, Slic last_slash_--; } file_name = file_name.substr(last_slash_ + 1); - sb_ << '[' << file_name << ':' << line_num << ']'; + sb_ << '[' << file_name << ':' << static_cast(line_num) << ']'; } // context from tag_