38 #ifndef LOG4CPLUS_INTERNAL_CUSTOMLOGLEVELMANAGER_HEADER_
39 #define LOG4CPLUS_INTERNAL_CUSTOMLOGLEVELMANAGER_HEADER_
43 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
47 #if ! defined (INSIDE_LOG4CPLUS)
48 # error "This header must not be be used outside log4cplus' implementation files."
68 std::map<LogLevel,tstring>
ll2nm;
69 std::map<tstring,LogLevel>
nm2ll;
87 auto i =
ll2nm.lower_bound(ll);
88 if( ( i !=
ll2nm.end() ) && ( i->first == ll ) && ( i->second != nm ) )
91 auto j =
nm2ll.lower_bound(nm);
92 if( ( j !=
nm2ll.end() ) && ( j->first == nm ) && ( j->second != ll ) )
96 ll2nm.insert( i, std::make_pair(ll, nm) );
97 nm2ll.insert( j, std::make_pair(nm, ll) );
105 auto i =
ll2nm.find(ll);
106 auto j =
nm2ll.find(nm);
107 if( ( i !=
ll2nm.end() ) && ( j !=
nm2ll.end() ) &&
108 ( i->first == j->second ) && ( i->second == j->first ) ) {
123 auto i =
ll2nm.find(ll);
124 if( i !=
ll2nm.end() )
133 auto i =
nm2ll.find(nm);
134 if( i !=
nm2ll.end() )
void pushFromStringMethod(StringToLogLevelMethod newFromString)
When creating a "derived" LogLevel, a StringToLogLevelMethod should be defined and registered with th...
void pushToStringMethod(LogLevelToStringMethod newToString)
When creating a "derived" LogLevel, a LogLevelToStringMethod should be defined and registered with th...
Custom log level manager used by C API.
std::map< LogLevel, tstring > ll2nm
static LOG4CPLUS_PRIVATE tstring const & customToStringMethod(LogLevel ll)
LogLevel customFromStringMethodWorker(const tstring &nm)
static LOG4CPLUS_PRIVATE LogLevel customFromStringMethod(const tstring &nm)
bool remove(LogLevel ll, tstring const &nm)
bool add(LogLevel ll, tstring const &nm)
tstring const & customToStringMethodWorker(LogLevel ll)
log4cplus::thread::Mutex mtx
std::map< tstring, LogLevel > nm2ll
#define LOG4CPLUS_PRIVATE
This header contains declaration internal to log4cplus.
log4cplus::tstring const empty_str
Canonical empty string.
LOG4CPLUS_PRIVATE CustomLogLevelManager & getCustomLogLevelManager()
std::basic_string< tchar > tstring
const LogLevel NOT_SET_LOG_LEVEL
The NOT_SET_LOG_LEVEL LogLevel is used to indicated that no particular LogLevel is desired and that t...
LOG4CPLUS_EXPORT LogLevelManager & getLogLevelManager()
Returns the singleton LogLevelManager.
int LogLevel
Defines the minimum set of priorities recognized by the system, that is FATAL_LOG_LEVEL,...