sink.h
Go to the documentation of this file.
1 //
2 // Copyright(c) 2015 Gabi Melman.
3 // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 //
5 
6 
7 #pragma once
8 
10 
11 namespace spdlog
12 {
13 namespace sinks
14 {
15 class sink
16 {
17 public:
18  sink()
19  {
21  }
22 
23  virtual ~sink() {}
24  virtual void log(const details::log_msg& msg) = 0;
25  virtual void flush() = 0;
26 
27  bool should_log(level::level_enum msg_level) const;
28  void set_level(level::level_enum log_level);
29  level::level_enum level() const;
30 
31 private:
33 
34 };
35 
36 inline bool sink::should_log(level::level_enum msg_level) const
37 {
38  return msg_level >= _level.load(std::memory_order_relaxed);
39 }
40 
41 inline void sink::set_level(level::level_enum log_level)
42 {
43  _level.store(log_level);
44 }
45 
47 {
48  return static_cast<spdlog::level::level_enum>(_level.load(std::memory_order_relaxed));
49 }
50 
51 }
52 }
53 
bool should_log(level::level_enum msg_level) const
Definition: sink.h:36
virtual void log(const details::log_msg &msg)=0
virtual void flush()=0
level::level_enum level() const
Definition: sink.h:46
virtual ~sink()
Definition: sink.h:23
level_t _level
Definition: sink.h:32
void set_level(level::level_enum log_level)
Definition: sink.h:41
std::atomic< int > level_t


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:12:07