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