Agora  1.2.0
Agora project
sink.h
Go to the documentation of this file.
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 
7 #include <spdlog/formatter.h>
8 
9 namespace spdlog {
10 
11 namespace sinks {
13 {
14 public:
15  virtual ~sink() = default;
16  virtual void log(const details::log_msg &msg) = 0;
17  virtual void flush() = 0;
18  virtual void set_pattern(const std::string &pattern) = 0;
19  virtual void set_formatter(std::unique_ptr<spdlog::formatter> sink_formatter) = 0;
20 
21  void set_level(level::level_enum log_level);
22  level::level_enum level() const;
23  bool should_log(level::level_enum msg_level) const;
24 
25 protected:
26  // sink log level - default is all
28 };
29 
30 } // namespace sinks
31 } // namespace spdlog
32 
33 #ifdef SPDLOG_HEADER_ONLY
34 # include "sink-inl.h"
35 #endif
spdlog::sinks::sink
Definition: sink.h:12
spdlog::level::trace
@ trace
Definition: common.h:213
spdlog::set_level
SPDLOG_INLINE void set_level(level::level_enum log_level)
Definition: spdlog-inl.h:60
spdlog::level_t
std::atomic< int > level_t
Definition: common.h:194
spdlog::set_pattern
SPDLOG_INLINE void set_pattern(std::string pattern, pattern_time_type time_type)
Definition: spdlog-inl.h:30
spdlog::level::level_enum
level_enum
Definition: common.h:211
spdlog
Definition: async.h:25
sink-inl.h
spdlog::set_formatter
SPDLOG_INLINE void set_formatter(std::unique_ptr< spdlog::formatter > formatter)
Definition: spdlog-inl.h:25
spdlog::details::log_msg
Definition: log_msg.h:11
spdlog::should_log
SPDLOG_INLINE bool should_log(level::level_enum log_level)
Definition: spdlog-inl.h:55
formatter.h
SPDLOG_API
#define SPDLOG_API
Definition: common.h:40
log_msg.h
spdlog::log
void log(source_loc source, level::level_enum lvl, format_string_t< Args... > fmt, Args &&... args)
Definition: spdlog.h:131