23 lines
725 B
C
Raw Normal View History

2021-07-08 07:07:27 -07:00
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#ifndef SPDLOG_HEADER_ONLY
2024-02-04 13:43:17 +01:00
#include <spdlog/sinks/sink.h>
2021-07-08 07:07:27 -07:00
#endif
#include <spdlog/common.h>
2021-07-08 07:07:27 -07:00
2024-02-04 13:43:17 +01:00
SPDLOG_INLINE bool spdlog::sinks::sink::should_log(spdlog::level::level_enum msg_level) const {
2021-07-08 07:07:27 -07:00
return msg_level >= level_.load(std::memory_order_relaxed);
}
2024-02-04 13:43:17 +01:00
SPDLOG_INLINE void spdlog::sinks::sink::set_level(level::level_enum log_level) {
2021-07-08 07:07:27 -07:00
level_.store(log_level, std::memory_order_relaxed);
}
2024-02-04 13:43:17 +01:00
SPDLOG_INLINE spdlog::level::level_enum spdlog::sinks::sink::level() const {
2021-07-08 07:07:27 -07:00
return static_cast<spdlog::level::level_enum>(level_.load(std::memory_order_relaxed));
}