File: customloglevel.cxx

package info (click to toggle)
log4cplus 2.0.5-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 10,560 kB
  • sloc: cpp: 46,669; sh: 10,310; ansic: 1,845; python: 1,114; perl: 258; makefile: 214; 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);
}