testNDC.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include "log4cpp/NDC.hh"
3 
4 using namespace log4cpp;
5 
6 int main(int argc, char** argv) {
7  std::cout << "1. empty NDC: " << NDC::get() << std::endl;
8 
9  NDC::push("context1");
10  std::cout << "2. push context1: " << NDC::get() << std::endl;
11 
12  NDC::push("context2");
13  std::cout << "3. push context2: " << NDC::get() << std::endl;
14  NDC::push("context3");
15  std::cout << "4. push context3: " << NDC::get() << std::endl;
16  std::cout << "5. get depth: " << NDC::getDepth() << std::endl;
17 
18  std::cout << "6. pop: " << NDC::pop() << std::endl;
19 
20  NDC::clear();
21  std::cout << "7. clear: " << NDC::get() << std::endl;
22 
23  return 0;
24 }
25 
26 
static const std::string & get()
Definition: NDC.cpp:42
int main(int argc, char **argv)
Definition: testNDC.cpp:6
static void push(const std::string &message)
Definition: NDC.cpp:61
static size_t getDepth()
Definition: NDC.cpp:49
static std::string pop()
Definition: NDC.cpp:57
static void clear()
Definition: NDC.cpp:34


log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Jun 23 2019 19:10:00