FilterStack Struct
Independently-owned state backing the filter stack. More...
Declaration
Public Member Functions Index
| void | remove (std::uint64_t id) |
|
Remove the filter with the given id. No-op if it is not present. Thread-safe. More... | |
Public Member Attributes Index
| std::mutex | mutex |
|
Guards entries and next_id. More... | |
| std::vector< FilterEntry > | entries |
| std::uint64_t | next_id = 0 |
|
Monotonic counter handing out unique ids for FilterEntry. More... | |
Description
Independently-owned state backing the filter stack.
The logger holds this by shared_ptr; each FilterToken references it by weak_ptr. A token that outlives its logger therefore removes nothing instead of dereferencing a destroyed logger — no use-after-free. Only the top entry is consulted per message; entries are removed by id, so out-of-order token destruction is handled correctly even though nested decorators normally pop in LIFO order. Empty in the common case, in which logging behaves identically to before this mechanism existed.
Definition at line 147 of file logger.hpp.
Public Member Functions
remove()
|
Remove the filter with the given id. No-op if it is not present. Thread-safe.
Declaration at line 156 of file logger.hpp, definition at line 126 of file logger.cpp.
Public Member Attributes
entries
|
Definition at line 151 of file logger.hpp.
mutex
|
Guards entries and next_id.
Definition at line 150 of file logger.hpp.
next_id
|
Monotonic counter handing out unique ids for FilterEntry.
Definition at line 153 of file logger.hpp.
The documentation for this struct was generated from the following files:
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.