/ src / loglevel.hpp
loglevel.hpp
 1  // SPDX-FileCopyrightText: Copyright (C) 2024-2025 Marek Küthe <m.k@mk16.de>
 2  //
 3  // SPDX-License-Identifier: GPL-3.0-or-later
 4  
 5  #ifndef LOGLEVEL_HPP
 6  #define LOGLEVEL_HPP
 7  
 8  #include <string>
 9  #include <boost/log/core.hpp>
10  #include <boost/log/expressions.hpp>
11  #include <boost/log/trivial.hpp>
12  
13  class LogLevel
14  {
15      public:
16          explicit LogLevel(boost::log::trivial::severity_level log_level);
17          explicit LogLevel(const std::string_view log_level_string);
18          [[nodiscard]] const boost::log::trivial::severity_level&
19              get_log_level() const noexcept;
20          void apply() const;
21  
22      private:
23          boost::log::trivial::severity_level _log_level;
24  };
25  
26  #endif