OGLplus  (0.59.0) a C++ wrapper for rendering APIs

null_backend.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_LOGGING_NULL_BACKEND_HPP
10 #define EAGINE_LOGGING_NULL_BACKEND_HPP
11 
12 #include "backend.hpp"
13 
14 namespace eagine {
15 //------------------------------------------------------------------------------
16 struct null_log_backend : logger_backend {
17 
18  auto entry_backend(identifier, log_event_severity) noexcept
19  -> logger_backend* final {
20  return nullptr;
21  }
22 
23  auto allocator() noexcept -> memory::shared_byte_allocator final {
24  return {};
25  }
26 
27  auto type_id() noexcept -> identifier final {
28  return EAGINE_ID(Null);
29  }
30 
31  void enter_scope(identifier) noexcept final {}
32 
33  void leave_scope(identifier) noexcept final {}
34 
35  void set_description(
36  identifier,
39  string_view) noexcept final {}
40 
41  auto begin_message(
42  identifier,
43  identifier,
46  string_view) noexcept -> bool final {
47  return false;
48  }
49 
50  void add_nothing(identifier, identifier) noexcept final {}
51 
52  void add_identifier(identifier, identifier, identifier) noexcept final {}
53 
54  void add_message_id(identifier, identifier, message_id) noexcept final {}
55 
56  void add_bool(identifier, identifier, bool) noexcept final {}
57 
58  void add_integer(identifier, identifier, std::intmax_t) noexcept final {}
59 
60  void add_unsigned(identifier, identifier, std::uintmax_t) noexcept final {}
61 
62  void add_float(identifier, identifier, float) noexcept final {}
63 
64  void add_float(identifier, identifier, float, float, float) noexcept final {
65  }
66 
67  void add_duration(
68  identifier,
69  identifier,
70  std::chrono::duration<float>) noexcept final {}
71 
72  void add_string(identifier, identifier, string_view) noexcept final {}
73 
74  void add_blob(identifier, identifier, memory::const_block) noexcept final {}
75 
76  void finish_message() noexcept final {}
77 
78  void finish_log() noexcept final {}
79 
80  void log_chart_sample(
81  identifier,
83  identifier,
84  float) noexcept final {}
85 };
86 //------------------------------------------------------------------------------
87 } // namespace eagine
88 
89 #endif // EAGINE_LOGGING_NULL_BACKEND_HPP
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
#define EAGINE_ID(NAME)
Macro for constructing instances of eagine::identifier.
Definition: identifier.hpp:353
Common code is placed in this namespace.
Definition: eagine.hpp:21
std::uintptr_t logger_instance_id
Logger object instance id type.
Definition: backend.hpp:56
basic_block< true > const_block
Alias for const byte memory span.
Definition: block.hpp:32
log_event_severity
Log event severity enumeration.
Definition: severity.hpp:18
basic_identifier< 10, 6, default_identifier_char_set, identifier_t > identifier
Default identifier type used throughout the project.
Definition: identifier.hpp:346

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).