Skip to content

Commit

Permalink
Minor change in ifdef for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime committed Sep 30, 2020
1 parent c8dc318 commit 5b34553
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/spdlog/logger-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ SPDLOG_INLINE void logger::err_handler_(const std::string &msg)
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(R_R_H) || !defined(USING_R)
std::fprintf(stderr, "[*** LOG ERROR #%04zu ***] [%s] [%s] {%s}\n", err_counter, date_buf, name().c_str(), msg.c_str());
#else // compiled in R environment
#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(), msg.c_str());
#else
std::fprintf(stderr, "[*** LOG ERROR #%04zu ***] [%s] [%s] {%s}\n", err_counter, date_buf, name().c_str(), msg.c_str());
#endif
}
}
Expand Down

0 comments on commit 5b34553

Please sign in to comment.