|
|
@ -174,16 +174,15 @@ SPDLOG_INLINE void logger::err_handler_(const std::string &msg) {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
using std::chrono::system_clock;
|
|
|
|
using std::chrono::system_clock;
|
|
|
|
auto now = system_clock::now();
|
|
|
|
auto now = system_clock::now();
|
|
|
|
auto err_counter_val = err_counter.fetch_add(1, std::memory_order_relaxed)+1;
|
|
|
|
|
|
|
|
auto tm_time = details::os::localtime(system_clock::to_time_t(now));
|
|
|
|
auto tm_time = details::os::localtime(system_clock::to_time_t(now));
|
|
|
|
char date_buf[64];
|
|
|
|
char date_buf[64];
|
|
|
|
std::strftime(date_buf, sizeof(date_buf), "%Y-%m-%d %H:%M:%S", &tm_time);
|
|
|
|
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
|
|
|
|
#if defined(USING_R) && defined(R_R_H) // if in R environment
|
|
|
|
REprintf("[*** LOG ERROR #%04zu ***] [%s] [%s] %s\n",
|
|
|
|
REprintf("[*** LOG ERROR ***] [%s] [%s] %s\n",
|
|
|
|
err_counter_val, date_buf, name().c_str(), msg.c_str());
|
|
|
|
date_buf, name().c_str(), msg.c_str());
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
std::fprintf(stderr, "[*** LOG ERROR #%04zu ***] [%s] [%s] %s\n", err_counter_val, date_buf,
|
|
|
|
std::fprintf(stderr, "[*** LOG ERROR ***] [%s] [%s] %s\n",
|
|
|
|
name().c_str(), msg.c_str());
|
|
|
|
date_buf, name().c_str(), msg.c_str());
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|