sink-inl.h 725 B

12345678910111213141516171819202122232425
  1. // Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
  2. // Distributed under the MIT License (http://opensource.org/licenses/MIT)
  3. #pragma once
  4. #ifndef SPDLOG_HEADER_ONLY
  5. # include <spdlog/sinks/sink.h>
  6. #endif
  7. #include <spdlog/common.h>
  8. SPDLOG_INLINE bool spdlog::sinks::sink::should_log(spdlog::level::level_enum msg_level) const
  9. {
  10. return msg_level >= level_.load(std::memory_order_relaxed);
  11. }
  12. SPDLOG_INLINE void spdlog::sinks::sink::set_level(level::level_enum log_level)
  13. {
  14. level_.store(log_level, std::memory_order_relaxed);
  15. }
  16. SPDLOG_INLINE spdlog::level::level_enum spdlog::sinks::sink::level() const
  17. {
  18. return static_cast<spdlog::level::level_enum>(level_.load(std::memory_order_relaxed));
  19. }