diff options
Diffstat (limited to 'server')
| -rw-r--r-- | server/common/log.hpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/server/common/log.hpp b/server/common/log.hpp index 505faed..573590b 100644 --- a/server/common/log.hpp +++ b/server/common/log.hpp @@ -5,10 +5,8 @@ #pragma once -#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/system/error_code.hpp> -#include <ctime> #include <exception> #include <format> #include <iomanip> @@ -20,7 +18,6 @@ #include <utility> namespace math::server::log { - namespace details { inline std::string get_tid() { @@ -30,11 +27,8 @@ inline std::string get_tid() { } inline std::string get_timestamp() { - const auto now = boost::posix_time::second_clock::universal_time(); - const auto tm = boost::posix_time::to_tm(now); - std::ostringstream oss; - oss << std::put_time(&tm, "%Y-%m-%d %H:%M:%S"); - return oss.str(); + const auto now = std::chrono::system_clock::now(); + return std::format("{:%F %T%z}", std::chrono::floor<std::chrono::seconds>(now)); } inline void log(const std::string& msg) { |
