From 045c0b0d46946c66144653e27163b4bd260df315 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 2 Oct 2023 01:40:59 +0300 Subject: [PATCH] Removed another static var fro default error handler --- src/logger.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/logger.cpp b/src/logger.cpp index 81e8473a..810243d1 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -90,17 +90,15 @@ void logger::err_handler_(const std::string &msg) { custom_err_handler_(msg); } else { using std::chrono::system_clock; - static size_t err_counter = 0; auto now = system_clock::now(); - err_counter++; auto tm_time = details::os::localtime(system_clock::to_time_t(now)); char date_buf[64]; std::strftime(date_buf, sizeof(date_buf), "%Y-%m-%d %H:%M:%S", &tm_time); #if defined(USING_R) && defined(R_R_H) // if in R environment - REprintf("[*** LOG ERROR #%04zu ***] [%s] [%s] %s\n", err_counter, date_buf, name().c_str(), + REprintf("[*** LOG ERROR ***] [%s] [%s] %s\n", date_buf, name().c_str(), msg.c_str()); #else - std::fprintf(stderr, "[*** LOG ERROR #%04zu ***] [%s] [%s] %s\n", err_counter, date_buf, + std::fprintf(stderr, "[*** LOG ERROR ***] [%s] [%s] %s\n", date_buf, name().c_str(), msg.c_str()); #endif }