21#include <log4cxx/log4cxx.h>
36class LOG4CXX_EXPORT
MDC
41 typedef std::map<LogString, LogString>
Map;
50 MDC(
const std::string& key,
const std::string& value);
63 static void put(
const std::string& key,
const std::string& value);
81 static std::string
get(
const std::string& key);
96 static std::string
remove(
const std::string& key);
97#if LOG4CXX_WCHAR_T_API
105 MDC(
const std::wstring& key,
const std::wstring& value);
116 static void put(
const std::wstring& key,
const std::wstring& value);
124 static std::wstring
get(
const std::wstring& key);
131 static std::wstring
remove(
const std::wstring& key);
133#if LOG4CXX_UNICHAR_API
141 MDC(
const std::basic_string<UniChar>& key,
const std::basic_string<UniChar>& value);
152 static void put(
const std::basic_string<UniChar>& key,
const std::basic_string<UniChar>& value);
160 static std::basic_string<UniChar>
get(
const std::basic_string<UniChar>& key);
167 static std::basic_string<UniChar>
remove(
const std::basic_string<UniChar>& key);
169#if LOG4CXX_CFSTRING_API
221 MDC& operator=(
const MDC&);
222 LOG4CXX_DECLARE_PRIVATE_MEMBER(
LogString, key)
The MDC class is similar to the NDC class except that it is based on a map instead of a stack.
Definition: mdc.h:37
MDC(const std::wstring &key, const std::wstring &value)
Places a key/value pair in the MDC for the current thread which will be removed during the correspond...
MDC(const std::string &key, const std::string &value)
Places a key/value pair in the MDC for the current thread which will be removed during the correspond...
MDC(const std::basic_string< UniChar > &key, const std::basic_string< UniChar > &value)
Places a key/value pair in the MDC for the current thread which will be removed during the correspond...
static bool get(const LogString &key, LogString &dest)
Gets the context identified by the key parameter.
MDC(const CFStringRef &key, const CFStringRef &value)
Places a key/value pair in the MDC for the current thread which will be removed during the correspond...
static void clear()
Clear all entries in the MDC.
static std::string remove(const std::string &key)
Remove the the context identified by the key parameter.
static std::basic_string< UniChar > remove(const std::basic_string< UniChar > &key)
Remove the the context identified by the key parameter.
static void putLS(const LogString &key, const LogString &value)
Put a context value (the o parameter) as identified with the key parameter into the current thread's ...
static void put(const CFStringRef &key, const CFStringRef &value)
Put a context value (the o parameter) as identified with the key parameter into the current thread's ...
static void put(const std::string &key, const std::string &value)
Put a context value (the o parameter) as identified with the key parameter into the current thread's ...
static void put(const std::wstring &key, const std::wstring &value)
Put a context value (the o parameter) as identified with the key parameter into the current thread's ...
static std::basic_string< UniChar > get(const std::basic_string< UniChar > &key)
Get the context identified by the key parameter.
static bool remove(const LogString &key, LogString &prevValue)
Remove the the context identified by the key parameter.
static void put(const std::basic_string< UniChar > &key, const std::basic_string< UniChar > &value)
Put a context value (the o parameter) as identified with the key parameter into the current thread's ...
static std::string get(const std::string &key)
Get the context identified by the key parameter.
static CFStringRef get(const CFStringRef &key)
Get the context identified by the key parameter.
static std::wstring remove(const std::wstring &key)
Remove the the context identified by the key parameter.
static CFStringRef remove(const CFStringRef &key)
Remove the the context identified by the key parameter.
static std::wstring get(const std::wstring &key)
Get the context identified by the key parameter.
std::map< LogString, LogString > Map
String to string stl map.
Definition: mdc.h:41
const struct __CFString * CFStringRef
Definition: logstring.h:30
Definition: configuration.h:25
std::basic_string< logchar > LogString
Definition: logstring.h:60