|
Flow 2.0.0
Flow project: Public API.
|
Identical to Log_context but is safe w/r/t to set_logger(), assignment, and swap() done concurrently to ops (especially get_logger()) on the same *this.
More...
#include <log.hpp>
Public Member Functions | |
| Log_context_mt (Logger *logger=nullptr) | |
| Identical to Log_context API. More... | |
| template<typename Component_payload > | |
| Log_context_mt (Logger *logger, Component_payload component_payload) | |
| Identical to Log_context API. More... | |
| Log_context_mt (const Log_context_mt &src) | |
| Identical to Log_context API. More... | |
| Log_context_mt (Log_context_mt &&src) | |
| Identical to Log_context API. More... | |
| Log_context_mt & | operator= (const Log_context_mt &src) |
Identical to Log_context API; but safe against concurrent operations on a *this. More... | |
| Log_context_mt & | operator= (Log_context_mt &&src) |
Identical to Log_context API; but safe against concurrent operations on a *this. More... | |
| void | swap (Log_context_mt &other) |
Identical to Log_context API; but safe against concurrent operations on a *this. More... | |
| Logger * | get_logger () const |
Identical to Log_context API; but safe against concurrent operations on a *this. More... | |
| Logger * | set_logger (Logger *logger) |
Identical to Log_context API; but safe against concurrent operations on a *this. More... | |
| const Component & | get_log_component () const |
| Identical to Log_context API. More... | |
Identical to Log_context but is safe w/r/t to set_logger(), assignment, and swap() done concurrently to ops (especially get_logger()) on the same *this.
There is a perf trade-off: essentially all operations will lock an internal mutex, proceed, then unlock. This will have a small cost when there is no lock contention (no simultaneous logging – get_logger() calls); and a larger cost when there is (when indeed there is simultaneous logging – therefore get_logger() calls). Informally: in our experience, as noted in the aforementioned doc header discussion, set_logger() is mainly used when the sub-class is instantiated statically or globally; and usually it is possible to simply avoid logging along fast-paths of such classes.
Still: it requires care. If you need to provide/use set_logger(), be mindful of this potential source of slow-down.
|
explicit |
Identical to Log_context API.
| logger | See above. |
|
explicit |
Identical to Log_context API.
| Component_payload | See above. |
| logger | See above. |
| component_payload | See above. |
|
explicit |
Identical to Log_context API.
| src | See above. |
| flow::log::Log_context_mt::Log_context_mt | ( | Log_context_mt && | src | ) |
Identical to Log_context API.
| src | See above. |
| const Component & flow::log::Log_context_mt::get_log_component | ( | ) | const |
Identical to Log_context API.
| Logger * flow::log::Log_context_mt::get_logger | ( | ) | const |
Identical to Log_context API; but safe against concurrent operations on a *this.
| Log_context_mt & flow::log::Log_context_mt::operator= | ( | const Log_context_mt & | src | ) |
Identical to Log_context API; but safe against concurrent operations on a *this.
| src | See above. |
| Log_context_mt & flow::log::Log_context_mt::operator= | ( | Log_context_mt && | src | ) |
Identical to Log_context API; but safe against concurrent operations on a *this.
| src | See above. |
Identical to Log_context API; but safe against concurrent operations on a *this.
| logger | See above. |
| void flow::log::Log_context_mt::swap | ( | Log_context_mt & | other | ) |
Identical to Log_context API; but safe against concurrent operations on a *this.
| other | See above. |