diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/spdlog/details/periodic_worker.h | 3 | ||||
-rw-r--r-- | include/spdlog/spdlog.h | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/include/spdlog/details/periodic_worker.h b/include/spdlog/details/periodic_worker.h index 919ba7ed..d7d69b28 100644 --- a/include/spdlog/details/periodic_worker.h +++ b/include/spdlog/details/periodic_worker.h @@ -21,7 +21,8 @@ class SPDLOG_API periodic_worker { public: template<typename Rep, typename Period> - periodic_worker(const std::function<void()> &callback_fun, std::chrono::duration<Rep, Period> interval) { + periodic_worker(const std::function<void()> &callback_fun, std::chrono::duration<Rep, Period> interval) + { active_ = (interval > std::chrono::duration<Rep, Period>::zero()); if (!active_) { diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index 40c2bcad..ee83e8de 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -293,9 +293,10 @@ inline void critical(const T &msg) // #ifndef SPDLOG_NO_SOURCE_LOC -#define SPDLOG_LOGGER_CALL(logger, level, ...) (logger)->log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__) +# define SPDLOG_LOGGER_CALL(logger, level, ...) \ + (logger)->log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__) #else -#define SPDLOG_LOGGER_CALL(logger, level, ...) (logger)->log(spdlog::source_loc{}, level, __VA_ARGS__) +# define SPDLOG_LOGGER_CALL(logger, level, ...) (logger)->log(spdlog::source_loc{}, level, __VA_ARGS__) #endif #if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE |