9 #ifndef CPPLOGGING_TRIGGER_H
10 #define CPPLOGGING_TRIGGER_H
31 explicit Trigger(
bool state =
true) : _state(state) {}
43 void Enable() noexcept { _state =
true; }
45 void Disable() noexcept { _state =
false; }
47 void Toggle() noexcept { _state = !_state; }
54 std::atomic<bool> _state;
Logging filter interface.
Trigger & operator=(Trigger &&)=delete
void Enable() noexcept
Enable logging.
bool IsEnabled() noexcept
Is logging enabled?
void Toggle() noexcept
Toggle logging.
Trigger(const Trigger &)=delete
virtual ~Trigger()=default
Trigger & operator=(const Trigger &)=delete
Trigger(Trigger &&)=delete
Trigger(bool state=true)
Initialize trigger with an initial logging state (enabled or disabled)
bool FilterRecord(Record &record) override
Filter the given logging record.
void Disable() noexcept
Disable logging.
Logging filter interface definition.
C++ Logging project definitions.