File: customloglevel.cxx

package info (click to toggle)
log4cplus 1.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,536 kB
  • sloc: sh: 10,603; cpp: 9,253; ansic: 706; makefile: 251
file content (40 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (2)
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

#include "customloglevel.h"

#define _CRITICAL_STRING LOG4CPLUS_TEXT("CRITICAL")



tstring
criticalToStringMethod(LogLevel ll)
{
    if(ll == CRITICAL_LOG_LEVEL) {
        return _CRITICAL_STRING;
    }
    else {
        return tstring();
    }
}



LogLevel
criticalFromStringMethod(const tstring& s) 
{
    if(s == _CRITICAL_STRING) return CRITICAL_LOG_LEVEL;

    return NOT_SET_LOG_LEVEL;
}



class CriticalLogLevelInitializer {
public:
    CriticalLogLevelInitializer() {
        getLogLevelManager().pushToStringMethod(criticalToStringMethod);
        getLogLevelManager().pushFromStringMethod(criticalFromStringMethod);
    }
};

CriticalLogLevelInitializer criticalLogLevelInitializer_;