#include <LogTrace.hpp>
Public Member Functions | |
LogTrace () | |
~LogTrace () | |
LogTrace (LogTrace const &)=delete | |
LogTrace & | operator= (LogTrace const &)=delete |
Static Public Member Functions | |
static void | PrintTrace (std::ostream &) |
static unsigned | GetChangeCounter () |
Protected Member Functions | |
virtual void | PrintTraceLine (std::ostream &)=0 |
Detailed Description
Can be instantiated on stack to give contextual information to log. Used for example during resource parsing to tell user that given log was printed on given line of input file during resource loading. Should work a bit like some kind of stack trace. This uses thread_local storage for static data so it can be used in multiple threads independently. This must be destroyed on the same thread it was constructed (it can be modified to allow that, but this behavior poses no risks for stack allocated LogTrace instances).
Definition at line 16 of file LogTrace.hpp.
Constructor & Destructor Documentation
◆ LogTrace() [1/2]
iv::LogTrace::LogTrace | ( | ) |
Definition at line 9 of file LogTrace.cpp.
◆ ~LogTrace()
iv::LogTrace::~LogTrace | ( | ) |
Definition at line 32 of file LogTrace.cpp.
◆ LogTrace() [2/2]
|
delete |
Member Function Documentation
◆ operator=()
◆ PrintTrace()
|
static |
Prints trace messages for all LogTrace instances that are currently instantiated on current thread. Trace messages are printed in order in which they were instantiated.
Definition at line 52 of file LogTrace.cpp.
◆ GetChangeCounter()
|
static |
This allows user to only print stack when it changes (eg. we have multiple log lines but want to print only one trace info for them). When this is the same as last time, no need to print it again.
Definition at line 47 of file LogTrace.cpp.
◆ PrintTraceLine()
|
protectedpure virtual |
Print current trace info. It is typically one line. Should end with a newline character.
Implemented in iv::Lex_LogTrace, iv::Resource_LogTrace, and iv::LambdaLogTrace.
The documentation for this class was generated from the following files:
- ivorium_core/Basics/LogTrace.hpp
- ivorium_core/Basics/LogTrace.cpp