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

entry.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_LOGGING_ENTRY_HPP
10 #define EAGINE_LOGGING_ENTRY_HPP
11 
12 #include "../bitfield.hpp"
13 #include "../branch_predict.hpp"
14 #include "../memory/object_storage.hpp"
15 #include "../message_id.hpp"
16 #include "../valid_if/decl.hpp"
17 #include "backend.hpp"
18 #include <sstream>
19 
20 namespace eagine {
21 //------------------------------------------------------------------------------
22 static inline auto adapt_log_entry_arg(identifier name, logger_backend* value) {
23  return [name, value](logger_backend& backend) {
24  if(value) {
25  backend.add_identifier(
26  name, EAGINE_ID(LogBkEndId), value->type_id());
27  } else {
28  backend.add_nothing(name, EAGINE_ID(LogBkEndId));
29  }
30  };
31 }
32 //------------------------------------------------------------------------------
33 template <typename T, typename = std::enable_if_t<has_enumerator_mapping_v<T>>>
34 static constexpr auto adapt_log_entry_arg(identifier name, T value) {
35  return [=](logger_backend& backend) {
36  backend.add_string(name, EAGINE_ID(enum), enumerator_name(value));
37  };
38 }
39 //------------------------------------------------------------------------------
40 template <typename T, typename = std::enable_if_t<has_enumerator_mapping_v<T>>>
41 static constexpr auto adapt_log_entry_arg(identifier name, bitfield<T> bf) {
42  return [=](logger_backend& backend) {
43  auto func = [&backend, name, bf](const auto& info) {
44  if(bf.has(static_cast<T>(info.value))) {
45  backend.add_string(name, EAGINE_ID(bitfield), info.name);
46  }
47  };
48  for_each_enumerator(func, type_identity<T>{});
49  };
50 }
51 //------------------------------------------------------------------------------
52 template <typename T>
53 struct does_have_log_entry_function;
54 
55 template <typename T>
56 using has_log_entry_function_t = typename does_have_log_entry_function<T>::type;
57 
58 template <typename T>
59 constexpr const bool has_log_entry_function_v =
60  has_log_entry_function_t<T>::value;
61 //------------------------------------------------------------------------------
62 class logger;
63 
67 class log_entry {
68 public:
71  identifier source_id,
72  logger_instance_id instance_id,
73  log_event_severity severity,
75  logger_backend* backend) noexcept
76  : _source_id{source_id}
77  , _instance_id{instance_id}
78  , _backend{backend}
79  , _format{format}
80  , _args{_be_alloc(_backend)}
81  , _severity{severity} {
82  if(_backend) {
83  _args.reserve(16);
84  }
85  }
86 
88  log_entry(log_entry&&) = delete;
90  log_entry(const log_entry&) = delete;
92  auto operator=(log_entry&&) = delete;
94  auto operator=(const log_entry&) = delete;
95 
97  ~log_entry() noexcept {
98  if(_backend) {
99  if(EAGINE_LIKELY(_backend->begin_message(
100  _source_id, _entry_tag, _instance_id, _severity, _format))) {
101  _args(*_backend);
102  _backend->finish_message();
103  _backend = nullptr;
104  }
105  }
106  }
107 
112  auto set_format(string_view format) noexcept -> auto& {
113  _format = format;
114  return *this;
115  }
116 
121  auto arg(identifier name, identifier tag, identifier value) noexcept
122  -> auto& {
123  if(_backend) {
124  _args.add([=](logger_backend& backend) {
125  backend.add_identifier(name, tag, value);
126  });
127  }
128  return *this;
129  }
130 
134  auto arg(identifier name, identifier value) noexcept -> auto& {
135  return arg(name, EAGINE_ID(Identifier), value);
136  }
137 
142  auto arg(identifier name, identifier tag, message_id value) noexcept
143  -> auto& {
144  if(_backend) {
145  _args.add([=](logger_backend& backend) {
146  backend.add_message_id(name, tag, value);
147  });
148  }
149  return *this;
150  }
151 
155  auto arg(identifier name, message_id value) noexcept -> auto& {
156  return arg(name, EAGINE_ID(MessageId), value);
157  }
158 
163  auto arg(identifier name, identifier tag, std::int64_t value) noexcept
164  -> auto& {
165  if(_backend) {
166  _args.add([=](logger_backend& backend) {
167  backend.add_integer(name, tag, value);
168  });
169  }
170  return *this;
171  }
172 
176  auto arg(identifier name, std::int64_t value) noexcept -> auto& {
177  return arg(name, EAGINE_ID(int64), value);
178  }
179 
183  auto arg(identifier name, identifier tag, span<const std::int64_t>) noexcept
184  -> log_entry&;
185 
188  auto arg(identifier name, span<const std::int64_t> values) noexcept
189  -> auto& {
190  return arg(name, EAGINE_ID(int64), values);
191  }
192 
197  auto arg(identifier name, identifier tag, std::int32_t value) noexcept
198  -> auto& {
199  if(_backend) {
200  _args.add([=](logger_backend& backend) {
201  backend.add_integer(name, tag, value);
202  });
203  }
204  return *this;
205  }
206 
210  auto arg(identifier name, std::int32_t value) noexcept -> auto& {
211  return arg(name, EAGINE_ID(int32), value);
212  }
213 
217  auto arg(identifier name, identifier tag, span<const std::int32_t>) noexcept
218  -> log_entry&;
219 
223  auto arg(identifier name, span<const std::int32_t> values) noexcept
224  -> auto& {
225  return arg(name, EAGINE_ID(int32), values);
226  }
227 
232  auto arg(identifier name, identifier tag, std::int16_t value) noexcept
233  -> auto& {
234  if(_backend) {
235  _args.add([=](logger_backend& backend) {
236  backend.add_integer(name, tag, value);
237  });
238  }
239  return *this;
240  }
241 
245  auto arg(identifier name, std::int16_t value) noexcept -> auto& {
246  return arg(name, EAGINE_ID(int16), value);
247  }
248 
252  auto arg(identifier name, identifier tag, span<const std::int16_t>) noexcept
253  -> log_entry&;
254 
257  auto arg(identifier name, span<const std::int16_t> values) noexcept
258  -> auto& {
259  return arg(name, EAGINE_ID(int16), values);
260  }
261 
266  auto arg(identifier name, identifier tag, std::uint64_t value) noexcept
267  -> auto& {
268  if(_backend) {
269  _args.add([=](logger_backend& backend) {
270  backend.add_unsigned(name, tag, value);
271  });
272  }
273  return *this;
274  }
275 
279  auto arg(identifier name, std::uint64_t value) noexcept -> auto& {
280  return arg(name, EAGINE_ID(int64), value);
281  }
282 
286  auto arg(identifier name, identifier tag, span<const std::uint64_t>) noexcept
287  -> log_entry&;
288 
291  auto arg(identifier name, span<const std::uint64_t> values) noexcept
292  -> auto& {
293  return arg(name, EAGINE_ID(uint64), values);
294  }
295 
300  auto arg(identifier name, identifier tag, std::uint32_t value) noexcept
301  -> auto& {
302  if(_backend) {
303  _args.add([=](logger_backend& backend) {
304  backend.add_unsigned(name, tag, value);
305  });
306  }
307  return *this;
308  }
309 
313  auto arg(identifier name, std::uint32_t value) noexcept -> auto& {
314  return arg(name, EAGINE_ID(uint32), value);
315  }
316 
320  auto arg(identifier name, identifier tag, span<const std::uint32_t>) noexcept
321  -> log_entry&;
322 
325  auto arg(identifier name, span<const std::uint32_t> values) noexcept
326  -> auto& {
327  return arg(name, EAGINE_ID(uint32), values);
328  }
329 
334  auto arg(identifier name, identifier tag, std::uint16_t value) noexcept
335  -> auto& {
336  if(_backend) {
337  _args.add([=](logger_backend& backend) {
338  backend.add_unsigned(name, tag, value);
339  });
340  }
341  return *this;
342  }
343 
347  auto arg(identifier name, std::uint16_t value) noexcept -> auto& {
348  return arg(name, EAGINE_ID(uint16), value);
349  }
350 
354  auto arg(identifier name, identifier tag, span<const std::uint16_t>) noexcept
355  -> log_entry&;
356 
359  auto arg(identifier name, span<const std::uint16_t> values) noexcept
360  -> auto& {
361  return arg(name, EAGINE_ID(uint16), values);
362  }
363 
368  auto arg(identifier name, identifier tag, float value) noexcept -> auto& {
369  if(_backend) {
370  _args.add([=](logger_backend& backend) {
371  backend.add_float(name, tag, value);
372  });
373  }
374  return *this;
375  }
376 
380  auto arg(identifier name, float value) noexcept -> auto& {
381  return arg(name, EAGINE_ID(real), value);
382  }
383 
386  auto arg(identifier name, double value) noexcept -> auto& {
387  return arg(name, float(value));
388  }
389 
393  auto arg(identifier name, identifier tag, span<const float>) noexcept
394  -> log_entry&;
395 
398  auto arg(identifier name, span<const float> values) noexcept -> auto& {
399  return arg(name, EAGINE_ID(real), values);
400  }
401 
406  auto arg(
407  identifier name,
408  identifier tag,
409  float min,
410  float value,
411  float max) noexcept -> auto& {
412  if(_backend) {
413  _args.add([=](logger_backend& backend) {
414  backend.add_float(name, tag, min, value, max);
415  });
416  }
417  return *this;
418  }
419 
423  auto arg(identifier name, float min, float value, float max) noexcept
424  -> auto& {
425  return arg(name, EAGINE_ID(real), min, value, max);
426  }
427 
432  template <typename R, typename P>
433  auto arg(
434  identifier name,
435  identifier tag,
436  std::chrono::duration<R, P> value) noexcept -> auto& {
437  if(_backend) {
438  _args.add([=](logger_backend& backend) {
439  backend.add_duration(
440  name,
441  tag,
442  std::chrono::duration_cast<std::chrono::duration<float>>(
443  value));
444  });
445  }
446  return *this;
447  }
448 
452  template <typename R, typename P>
453  auto arg(identifier name, std::chrono::duration<R, P> value) noexcept
454  -> auto& {
455  return arg(name, EAGINE_ID(duration), value);
456  }
457 
462  auto arg(identifier name, identifier tag, string_view value) noexcept
463  -> auto& {
464  if(_backend) {
465  _args.add([=](logger_backend& backend) {
466  backend.add_string(name, tag, value);
467  });
468  }
469  return *this;
470  }
471 
475  auto arg(identifier name, string_view value) noexcept -> auto& {
476  return arg(name, EAGINE_ID(str), value);
477  }
478 
483  auto arg(identifier name, identifier tag, const std::string& value) noexcept
484  -> auto& {
485  if(_backend) {
486  _args.add([=](logger_backend& backend) {
487  backend.add_string(name, tag, value);
488  });
489  }
490  return *this;
491  }
492 
496  auto arg(identifier name, const std::string& value) noexcept -> auto& {
497  return arg(name, EAGINE_ID(str), value);
498  }
499 
504  auto arg(identifier name, identifier tag, memory::const_block value) noexcept
505  -> auto& {
506  if(_backend) {
507  _args.add([=](logger_backend& backend) {
508  backend.add_blob(name, tag, value);
509  });
510  }
511  return *this;
512  }
513 
517  auto arg(identifier name, memory::const_block value) noexcept -> auto& {
518  return arg(name, EAGINE_ID(blk), value);
519  }
520 
522  template <typename Func>
523  auto arg_func(Func function) -> auto& {
524  if(_backend) {
525  _args.add(std::move(function));
526  }
527  return *this;
528  }
529 
534  template <typename T>
535  auto arg(identifier name, T&& value) noexcept
536  -> std::enable_if_t<has_log_entry_adapter_v<std::decay_t<T>>, log_entry&> {
537  if(_backend) {
538  _args.add(adapt_log_entry_arg(name, std::forward<T>(value)));
539  }
540  return *this;
541  }
542 
548  template <typename T, typename P, typename F>
549  auto arg(
550  identifier name,
551  identifier tag,
552  valid_if_or_fallback<T, P, F>&& opt) noexcept
553  -> std::enable_if_t<
554  has_log_entry_function_v<std::decay_t<T>> &&
555  has_log_entry_function_v<std::decay_t<F>>,
556  log_entry&> {
557  if(opt.is_valid()) {
558  return arg(name, tag, std::move(opt.value()));
559  }
560  return arg(name, std::move(opt.fallback()));
561  }
562 
569  template <typename T, typename P, typename F>
570  auto
571  arg(identifier name, identifier tag, valid_if<T, P> opt, F fbck) noexcept
572  -> std::enable_if_t<
573  has_log_entry_function_v<std::decay_t<T>> &&
574  has_log_entry_function_v<std::decay_t<F>>,
575  log_entry&> {
576  return arg(name, tag, either_or(std::move(opt), std::move(fbck)));
577  }
578 
580  auto tag(identifier entry_tag) noexcept -> auto& {
581  _entry_tag = entry_tag;
582  return *this;
583  }
584 
585 private:
586  identifier _source_id{};
587  identifier _entry_tag{};
588  logger_instance_id _instance_id{};
589  logger_backend* _backend{nullptr};
590  string_view _format{};
591  memory::callable_storage<void(logger_backend&)> _args;
593 
594  static auto _be_alloc(logger_backend* backend) noexcept
595  -> memory::shared_byte_allocator {
596  if(backend) {
597  return backend->allocator();
598  }
599  return {};
600  }
601 };
602 //------------------------------------------------------------------------------
606 struct no_log_entry {
607  template <typename T>
608  constexpr auto arg(identifier, T&&) noexcept -> auto& {
609  return *this;
610  }
611  template <typename T>
612  constexpr auto arg(identifier, identifier, T&&) noexcept -> auto& {
613  return *this;
614  }
615  constexpr auto arg(identifier, identifier, float, float, float) noexcept
616  -> auto& {
617  return *this;
618  }
619 
620  template <typename T>
621  constexpr auto arg(identifier, span<const T>) noexcept -> auto& {
622  return *this;
623  }
624 
625  template <typename T>
626  constexpr auto arg(identifier, identifier, span<const T>) noexcept
627  -> auto& {
628  return *this;
629  }
630 
631  template <typename T, typename P, typename F>
632  constexpr auto
633  arg(identifier, identifier, valid_if<T, P>, const F&) noexcept -> auto& {
634  return *this;
635  }
636 
637  template <typename Func>
638  constexpr auto arg_func(const Func&) -> auto& {
639  return *this;
640  }
641 
642  constexpr auto tag(identifier) noexcept -> auto& {
643  return *this;
644  }
645 };
646 //------------------------------------------------------------------------------
647 template <typename T>
648 struct does_have_log_entry_function {
649 private:
650  template <
651  typename X,
652  typename = decltype(std::declval<log_entry>().arg(
653  std::declval<identifier>(),
654  std::declval<identifier>(),
655  std::declval<X>()))>
656  static auto _test(X*) -> std::true_type;
657  static auto _test(...) -> std::false_type;
658 
659 public:
660  // NOLINTNEXTLINE(hicpp-vararg)
661  using type = decltype(_test(static_cast<T*>(nullptr)));
662 };
663 //------------------------------------------------------------------------------
668 public:
670  operator std::ostream&() noexcept {
671  return _out;
672  }
673 
675  identifier source_id,
676  logger_instance_id instance_id,
677  log_event_severity severity,
678  logger_backend* backend) noexcept
679  : _source_id{source_id}
680  , _instance_id{instance_id}
681  , _backend{backend}
682  , _severity{severity} {}
683 
684  stream_log_entry(stream_log_entry&&) = default;
685  stream_log_entry(const stream_log_entry&) = delete;
686  auto operator=(stream_log_entry&&) = delete;
687  auto operator=(const stream_log_entry&) = delete;
688 
689  ~stream_log_entry() noexcept {
690  try {
691  auto fmt_str(_out.str());
692  if(!fmt_str.empty()) {
693  if(_backend) {
694  if(EAGINE_LIKELY(_backend->begin_message(
695  _source_id,
696  _entry_tag,
697  _instance_id,
698  _severity,
699  fmt_str))) {
700  _backend->finish_message();
701  _backend = nullptr;
702  }
703  }
704  }
705  } catch(...) {
706  }
707  }
708 
709  auto tag(identifier entry_tag) noexcept -> auto& {
710  _entry_tag = entry_tag;
711  return *this;
712  }
713 
714 private:
715  std::stringstream _out{};
716  identifier _source_id{};
717  identifier _entry_tag{};
718  logger_instance_id _instance_id{};
719  logger_backend* _backend{nullptr};
721 };
722 //------------------------------------------------------------------------------
723 } // namespace eagine
724 
725 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
726 #include <eagine/logging/entry.inl>
727 #endif
728 
729 #endif // EAGINE_LOGGING_ENTRY_HPP
auto arg(identifier name, identifier tag, std::uint64_t value) noexcept -> auto &
Adds a new message argument with 64-bit unsigned integer value.
Definition: entry.hpp:266
virtual void add_string(identifier arg, identifier tag, string_view value) noexcept=0
Add argument with string value.
auto arg(identifier name, identifier tag, valid_if< T, P > opt, F fbck) noexcept -> std::enable_if_t< has_log_entry_function_v< std::decay_t< T >> &&has_log_entry_function_v< std::decay_t< F >>, log_entry & >
Adds a new message argument with valid_if or fallback value.
Definition: entry.hpp:571
auto arg(identifier name, span< const std::uint64_t > values) noexcept -> auto &
Adds a new message argument with 64-bit unsigned integer span.
Definition: entry.hpp:291
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
auto arg(identifier name, identifier tag, std::int16_t value) noexcept -> auto &
Adds a new message argument with 16-bit signed integer value.
Definition: entry.hpp:232
auto arg(identifier name, identifier tag, float min, float value, float max) noexcept -> auto &
Adds a new message argument with floating-point value.
Definition: entry.hpp:406
Common code is placed in this namespace.
Definition: eagine.hpp:21
auto arg(identifier name, identifier tag, string_view value) noexcept -> auto &
Adds a new message argument with string value.
Definition: entry.hpp:462
log_entry(identifier source_id, logger_instance_id instance_id, log_event_severity severity, string_view format, logger_backend *backend) noexcept
Constructor.
Definition: entry.hpp:70
auto arg(identifier name, std::uint64_t value) noexcept -> auto &
Adds a new message argument with 64-bit unsigned integer value.
Definition: entry.hpp:279
static auto either_or(valid_if< T, P > vi, F f) noexcept(noexcept(valid_if< T, P >(std::declval< valid_if< T, P > && >())) &&noexcept(F(std::declval< F && >()))) -> valid_if_or_fallback< T, P, F >
Constructor function for valid_if_or_fallback.
Definition: decl.hpp:290
auto arg(identifier name, std::chrono::duration< R, P > value) noexcept -> auto &
Adds a new message argument with time duration value.
Definition: entry.hpp:453
virtual void finish_message() noexcept=0
Finishes the current logging message.
std::uintptr_t logger_instance_id
Logger object instance id type.
Definition: backend.hpp:56
auto tag(identifier entry_tag) noexcept -> auto &
Adds an optional tag to this log entry.
Definition: entry.hpp:580
@ info
Informational log entries.
auto arg(identifier name, identifier tag, const std::string &value) noexcept -> auto &
Adds a new message argument with string value.
Definition: entry.hpp:483
auto arg(identifier name, span< const std::int16_t > values) noexcept -> auto &
Adds a new message argument with 16-bit signed integer span.
Definition: entry.hpp:257
auto arg(identifier name, std::int64_t value) noexcept -> auto &
Adds a new message argument with 64-bit signed integer value.
Definition: entry.hpp:176
auto arg(identifier name, double value) noexcept -> auto &
Adds a new message argument with double-precision float value.
Definition: entry.hpp:386
virtual void add_duration(identifier arg, identifier tag, std::chrono::duration< float > value) noexcept=0
Add argument with time duration value.
auto arg_func(Func function) -> auto &
Adds a new message argument adapted by the specified function.
Definition: entry.hpp:523
auto arg(identifier name, identifier tag, std::int64_t value) noexcept -> auto &
Adds a new message argument with 64-bit signed integer value.
Definition: entry.hpp:163
auto arg(identifier name, span< const std::uint16_t > values) noexcept -> auto &
Adds a new message argument with 16-bit unsigned integer span.
Definition: entry.hpp:359
auto operator=(log_entry &&)=delete
Not copy assignable.
auto arg(identifier name, identifier tag, message_id value) noexcept -> auto &
Adds a new message argument with message_id type value.
Definition: entry.hpp:142
auto arg(identifier name, identifier tag, identifier value) noexcept -> auto &
Adds a new message argument with identifier value.
Definition: entry.hpp:121
auto arg(identifier name, T &&value) noexcept -> std::enable_if_t< has_log_entry_adapter_v< std::decay_t< T >>, log_entry & >
Adds a new message argument with adaptable-type value.
Definition: entry.hpp:535
static auto format(std::string &&fmt_str) noexcept -> format_string_and_list< 0 >
Function taking a format string, returning an object for variable specification.
Definition: str_format.hpp:118
auto arg(identifier name, message_id value) noexcept -> auto &
Adds a new message argument with identifier value.
Definition: entry.hpp:155
auto arg(identifier name, identifier tag, std::int32_t value) noexcept -> auto &
Adds a new message argument with 32-bit signed integer value.
Definition: entry.hpp:197
Non-owning view of a contiguous range of memory with ValueType elements.
Definition: flatten_fwd.hpp:16
auto arg(identifier name, identifier tag, valid_if_or_fallback< T, P, F > &&opt) noexcept -> std::enable_if_t< has_log_entry_function_v< std::decay_t< T >> &&has_log_entry_function_v< std::decay_t< F >>, log_entry & >
Adds a new message argument with valid_if_or_fallback value.
Definition: entry.hpp:549
auto arg(identifier name, std::int32_t value) noexcept -> auto &
Adds a new message argument with 32-bit signed integer value.
Definition: entry.hpp:210
Do-nothing variant of log_entry with compatible API.
Definition: entry.hpp:606
auto arg(identifier name, span< const std::uint32_t > values) noexcept -> auto &
Adds a new message argument with 32-bit unsigned integer span.
Definition: entry.hpp:325
auto arg(identifier name, identifier value) noexcept -> auto &
Adds a new message argument with identifier value.
Definition: entry.hpp:134
~log_entry() noexcept
Destructor. Passed the actual entry to the backend.
Definition: entry.hpp:97
auto arg(identifier name, const std::string &value) noexcept -> auto &
Adds a new message argument with string value.
Definition: entry.hpp:496
virtual void add_identifier(identifier arg, identifier tag, identifier value) noexcept=0
Add argument with identifier value.
auto arg(identifier name, std::uint32_t value) noexcept -> auto &
Adds a new message argument with 32-bit unsigned integer value.
Definition: entry.hpp:313
auto arg(identifier name, identifier tag, float value) noexcept -> auto &
Adds a new message argument with floating-point value.
Definition: entry.hpp:368
auto arg(identifier name, span< const std::int64_t > values) noexcept -> auto &
Adds a new message argument with 64-bit signed integer span.
Definition: entry.hpp:188
auto arg(identifier name, string_view value) noexcept -> auto &
Adds a new message argument with string value.
Definition: entry.hpp:475
auto arg(identifier name, float value) noexcept -> auto &
Adds a new message argument with floating-point value.
Definition: entry.hpp:380
auto arg(identifier name, span< const std::int32_t > values) noexcept -> auto &
Adds a new message argument with 32-bit signed integer span.
Definition: entry.hpp:223
auto arg(identifier name, identifier tag, memory::const_block value) noexcept -> auto &
Adds a new message argument with BLOB value.
Definition: entry.hpp:504
log_event_severity
Log event severity enumeration.
Definition: severity.hpp:18
virtual void add_blob(identifier arg, identifier tag, memory::const_block value) noexcept=0
Add argument with BLOB value.
Interface for logging backend implementations.
Definition: backend.hpp:60
auto arg(identifier name, memory::const_block value) noexcept -> auto &
Adds a new message argument with BLOB value.
Definition: entry.hpp:517
Class representing a single log entry / message.
Definition: entry.hpp:67
virtual void add_unsigned(identifier arg, identifier tag, std::uintmax_t value) noexcept=0
Add argument with unsigned integer value.
Log entry helper containing an istream for creating the log message.
Definition: entry.hpp:667
Class storing two identifier values representing class/method pair.
Definition: message_id.hpp:25
auto set_format(string_view format) noexcept -> auto &
Sets the format string for this log entry.
Definition: entry.hpp:112
auto arg(identifier name, float min, float value, float max) noexcept -> auto &
Adds a new message argument with floating-point value.
Definition: entry.hpp:423
auto arg(identifier name, identifier tag, std::chrono::duration< R, P > value) noexcept -> auto &
Adds a new message argument with time duration value.
Definition: entry.hpp:433
virtual void add_float(identifier arg, identifier tag, float value) noexcept=0
Add argument with floating-point value.
virtual void add_integer(identifier arg, identifier tag, std::intmax_t value) noexcept=0
Add argument with signed integer value.
auto arg(identifier name, span< const float > values) noexcept -> auto &
Adds a new message argument with floating-point span.
Definition: entry.hpp:398
virtual auto begin_message(identifier source, identifier tag, logger_instance_id instance, log_event_severity severity, string_view format) noexcept -> bool=0
Begins a new logging message.
auto arg(identifier name, identifier tag, std::uint32_t value) noexcept -> auto &
Adds a new message argument with 32-bit unsigned integer value.
Definition: entry.hpp:300
auto arg(identifier name, identifier tag, std::uint16_t value) noexcept -> auto &
Adds a new message argument with 16-bit unsigned integer value.
Definition: entry.hpp:334
auto arg(identifier name, std::uint16_t value) noexcept -> auto &
Adds a new message argument with 16-bit unsigned integer value.
Definition: entry.hpp:347
Helper class storing both conditionally valid value and fallback.
Definition: decl.hpp:264
auto arg(identifier name, std::int16_t value) noexcept -> auto &
Adds a new message argument with 16-bit signed integer value.
Definition: entry.hpp:245
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).