testNDC.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 #include "log4cpp/NDC.hh"
00003 
00004 using namespace log4cpp;
00005 
00006 int main(int argc, char** argv) {
00007     std::cout << "1. empty NDC: " << NDC::get() << std::endl;
00008 
00009     NDC::push("context1");
00010     std::cout << "2. push context1: " << NDC::get() << std::endl;
00011     
00012     NDC::push("context2");
00013     std::cout << "3. push context2: " << NDC::get() << std::endl;
00014     NDC::push("context3");
00015     std::cout << "4. push context3: " << NDC::get() << std::endl;
00016     std::cout << "5. get depth: " << NDC::getDepth() << std::endl;
00017 
00018     std::cout << "6. pop: " << NDC::pop() << std::endl;
00019 
00020     NDC::clear();
00021     std::cout << "7. clear: " << NDC::get() << std::endl;
00022 
00023     return 0;
00024 }
00025     
00026     


log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Aug 14 2016 03:18:26