File: main.cxx

package info (click to toggle)
log4cplus 2.0.8-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,592 kB
  • sloc: cpp: 53,091; sh: 10,537; ansic: 1,845; python: 1,226; perl: 263; makefile: 209; xml: 85; objc: 59
file content (44 lines) | stat: -rw-r--r-- 1,153 bytes parent folder | download | duplicates (3)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

#include <iostream>
#include <log4cplus/helpers/loglog.h>
#include <log4cplus/logger.h>
#include <log4cplus/initializer.h>

using namespace std;
using namespace log4cplus::helpers;

void printMsgs() {
    cout << "Entering printMsgs()..." << endl;

    LogLog::getLogLog()->debug(LOG4CPLUS_TEXT("This is a Debug statement..."));
    LogLog::getLogLog()->debug(
        log4cplus::tstring(LOG4CPLUS_TEXT("This is a Debug statement...")));

    LogLog::getLogLog()->warn(LOG4CPLUS_TEXT("This is a Warning..."));
    LogLog::getLogLog()->warn(
        log4cplus::tstring(LOG4CPLUS_TEXT("This is a Warning...")));

    LogLog::getLogLog()->error(LOG4CPLUS_TEXT("This is a Error..."));
    LogLog::getLogLog()->error(
        log4cplus::tstring(LOG4CPLUS_TEXT("This is a Error...")));

    cout << "Exiting printMsgs()..." << endl << endl;
}


int
main() {
    log4cplus::Initializer initializer;
    printMsgs();

    cout << "Turning on debug..." << endl;
    LogLog::getLogLog()->setInternalDebugging(true);
    printMsgs();

    cout << "Turning on quiet mode..." << endl;
    LogLog::getLogLog()->setQuietMode(true);
    printMsgs();

    return 0;
}