File: customloglevel.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 (35 lines) | stat: -rw-r--r-- 667 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
#include "customloglevel.h"

static log4cplus::tstring const CRITICAL_STRING (LOG4CPLUS_TEXT("CRITICAL"));
static log4cplus::tstring const empty_str;


static
tstring const &
criticalToStringMethod(LogLevel ll)
{
    if(ll == CRITICAL_LOG_LEVEL) {
        return CRITICAL_STRING;
    }
    else {
        return empty_str;
    }
}


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

    return NOT_SET_LOG_LEVEL;
}



void initializeCriticalLogLevel ()
{
    getLogLevelManager().pushToStringMethod(criticalToStringMethod);
    getLogLevelManager().pushFromStringMethod(criticalFromStringMethod);
}