Skip to content

Commit 5b34553

Browse files
author
gabime
committed
Minor change in ifdef for clarity
1 parent c8dc318 commit 5b34553

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/spdlog/logger-inl.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,10 @@ SPDLOG_INLINE void logger::err_handler_(const std::string &msg)
247247
auto tm_time = details::os::localtime(system_clock::to_time_t(now));
248248
char date_buf[64];
249249
std::strftime(date_buf, sizeof(date_buf), "%Y-%m-%d %H:%M:%S", &tm_time);
250-
#if !defined(R_R_H) || !defined(USING_R)
251-
std::fprintf(stderr, "[*** LOG ERROR #%04zu ***] [%s] [%s] {%s}\n", err_counter, date_buf, name().c_str(), msg.c_str());
252-
#else // compiled in R environment
250+
#if defined(USING_R) && defined(R_R_H) // if in R environment
253251
REprintf("[*** LOG ERROR #%04zu ***] [%s] [%s] {%s}\n", err_counter, date_buf, name().c_str(), msg.c_str());
252+
#else
253+
std::fprintf(stderr, "[*** LOG ERROR #%04zu ***] [%s] [%s] {%s}\n", err_counter, date_buf, name().c_str(), msg.c_str());
254254
#endif
255255
}
256256
}

0 commit comments

Comments
 (0)