From 567b2eabe35a72499bb5dd81f7dcbeebc3737234 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 13 Jun 2026 22:40:22 +0200 Subject: log: print actual thread IDs --- server/common/log.hpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'server/common/log.hpp') diff --git a/server/common/log.hpp b/server/common/log.hpp index 573590b..2d1dba5 100644 --- a/server/common/log.hpp +++ b/server/common/log.hpp @@ -7,11 +7,16 @@ #include +#ifdef WIN32 +#include +#else +#include +#endif + #include #include #include #include -#include #include #include #include @@ -20,10 +25,12 @@ namespace math::server::log { namespace details { -inline std::string get_tid() { - std::ostringstream oss; - oss << std::this_thread::get_id(); - return oss.str(); +inline std::size_t get_tid() { +#ifdef WIN32 + return GetCurrentThreadId(); +#else + return gettid(); +#endif } inline std::string get_timestamp() { -- cgit v1.3