DUNE PDELab (git)
Dune::PDELab::LocalTag Class Reference
Insert standard boilerplate into log messages. More...
#include <dune/pdelab/common/logtag.hh>
Public Member Functions | |
const std::string & | str () const |
extract the static boilerplate message | |
template<class V > | |
LocalTag & | operator<< (const V &v) |
append something to the static boilerplate message | |
Detailed Description
Insert standard boilerplate into log messages.
This class can be used to create your own logtag locally, e.g. inside a function. When inserted into a std::ostream, it will insert the standard logtag and some static boilerplate string. The boilerplate string can be constructed by inserting into the localtag itself. Sample usage: \code
void myfunc() { LocalTag mytag; mytag << "myfunc(): "; std::cout << mytag << "Starting..." << std::endl;
for(unsigned stage = 0; stage < 42; ++stage) { LocalTag stagetag(mytag); stagetag << "stage " << stage << ": "; std::cout << stagetag << "Starting... << std::endl; do_somethin(stage); std::cout << stagetag << "Finished." << std::endl; } std::cout << mytag << "Finished." << std::endl; }
The documentation for this class was generated from the following file:
- dune/pdelab/common/logtag.hh
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.111.3
(Nov 23, 23:29, 2024)