File: testNDC.cpp

package info (click to toggle)
log4shib 1.0.9-3~bpo7%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports-sloppy
  • size: 4,244 kB
  • sloc: cpp: 4,767; sh: 4,210; ansic: 818; makefile: 268
file content (26 lines) | stat: -rw-r--r-- 684 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include "log4shib/NDC.hh"

using namespace log4shib;

int main(int argc, char** argv) {
    std::cout << "1. empty NDC: " << NDC::get() << std::endl;

    NDC::push("context1");
    std::cout << "2. push context1: " << NDC::get() << std::endl;
    
    NDC::push("context2");
    std::cout << "3. push context2: " << NDC::get() << std::endl;
    NDC::push("context3");
    std::cout << "4. push context3: " << NDC::get() << std::endl;
    std::cout << "5. get depth: " << NDC::getDepth() << std::endl;

    std::cout << "6. pop: " << NDC::pop() << std::endl;

    NDC::clear();
    std::cout << "7. clear: " << NDC::get() << std::endl;

    return 0;
}