|
Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
|
Convenience class for setting a single context field with RAII. More...
#include <log_context_scope.h>

Public Member Functions | |
| scoped_context (const std::string &key, const std::string &value) | |
| Construct with string value. | |
| scoped_context (const std::string &key, int64_t value) | |
| Construct with integer value. | |
| scoped_context (const std::string &key, int value) | |
| Construct with int value (converts to int64_t) | |
| scoped_context (const std::string &key, double value) | |
| Construct with double value. | |
| scoped_context (const std::string &key, bool value) | |
| Construct with boolean value. | |
| ~scoped_context () | |
| Destructor - restores or removes the context field. | |
| scoped_context (const scoped_context &)=delete | |
| scoped_context & | operator= (const scoped_context &)=delete |
| scoped_context (scoped_context &&)=delete | |
| scoped_context & | operator= (scoped_context &&)=delete |
Private Attributes | |
| std::string | key_ |
| log_value | previous_value_ |
| bool | had_previous_ |
Convenience class for setting a single context field with RAII.
Provides a simpler interface for setting a single context field that will be automatically removed when the scope exits.
Definition at line 347 of file log_context_scope.h.
|
inline |
Construct with string value.
Definition at line 352 of file log_context_scope.h.
References kcenon::logger::log_context_storage::get_field(), had_previous_, previous_value_, and kcenon::logger::log_context_storage::set().

|
inline |
Construct with integer value.
Definition at line 365 of file log_context_scope.h.
References kcenon::logger::log_context_storage::get_field(), had_previous_, previous_value_, and kcenon::logger::log_context_storage::set().

|
inline |
Construct with int value (converts to int64_t)
Definition at line 378 of file log_context_scope.h.
|
inline |
Construct with double value.
Definition at line 384 of file log_context_scope.h.
References kcenon::logger::log_context_storage::get_field(), had_previous_, previous_value_, and kcenon::logger::log_context_storage::set().

|
inline |
Construct with boolean value.
Definition at line 397 of file log_context_scope.h.
References kcenon::logger::log_context_storage::get_field(), had_previous_, previous_value_, and kcenon::logger::log_context_storage::set().

|
inline |
Destructor - restores or removes the context field.
Definition at line 410 of file log_context_scope.h.
References had_previous_, key_, previous_value_, kcenon::logger::log_context_storage::remove(), and kcenon::logger::log_context_storage::set().

|
delete |
|
delete |
|
delete |
|
delete |
|
private |
Definition at line 427 of file log_context_scope.h.
Referenced by scoped_context(), scoped_context(), scoped_context(), scoped_context(), and ~scoped_context().
|
private |
Definition at line 425 of file log_context_scope.h.
Referenced by ~scoped_context().
|
private |
Definition at line 426 of file log_context_scope.h.
Referenced by scoped_context(), scoped_context(), scoped_context(), scoped_context(), and ~scoped_context().