21#include <log4cxx/log4cxx.h>
78class LOG4CXX_EXPORT
NDC
85 typedef std::stack<DiagnosticContext>
Stack;
93 NDC(
const std::string& message);
168 static bool pop(std::string& buf);
183 static bool peek(std::string& buf);
191 static void push(
const std::string& message);
208#if LOG4CXX_WCHAR_T_API
215 NDC(
const std::wstring& message);
220 static void push(
const std::wstring& message);
226 static bool peek(std::wstring& dst);
232 static bool pop(std::wstring& dst);
234#if LOG4CXX_UNICHAR_API
241 NDC(
const std::basic_string<UniChar>& message);
248 static void push(
const std::basic_string<UniChar>& message);
254 static bool peek(std::basic_string<UniChar>& dst);
260 static bool pop(std::basic_string<UniChar>& dst);
262#if LOG4CXX_CFSTRING_API
291 NDC& operator=(
const NDC&);
A Nested Diagnostic Context, or NDC in short, is an instrument to distinguish interleaved log output ...
Definition: ndc.h:79
static void pushLS(const LogString &message)
Add message to the stack associated with the current thread.
NDC(const std::basic_string< UniChar > &message)
Add message onto the context stack.
std::stack< DiagnosticContext > Stack
Definition: ndc.h:85
static void push(const std::basic_string< UniChar > &message)
Add message to the stack associated with the current thread.
static void push(const CFStringRef &message)
Add message to the stack associated with the current thread.
~NDC()
Remove the topmost element from the context stack associated with the current thread.
static bool pop(CFStringRef &dst)
Append to dst the top value in the stack associated with the current thread and then remove it.
static LogString pop()
Get the value at the top of the stack associated with the current thread and then remove it.
static Stack * cloneStack()
Clone the diagnostic context for the current thread.
static void push(const std::string &message)
Add message to the stack associated with the current thread.
std::pair< LogString, LogString > DiagnosticContext
Pair of Message and FullMessage.
Definition: ndc.h:84
static bool pop(std::string &buf)
Append to buf the top value in the stack associated with the current thread and then remove it.
static void clear()
Clear any nested diagnostic information if any.
static bool peek(std::basic_string< UniChar > &dst)
Append to dst the top value in the stack associated with the current thread without removing it.
static void inherit(Stack *stack)
Inherit the diagnostic context of another thread.
static void push(const std::wstring &message)
Add message to the stack associated with the current thread.
static bool empty()
Tests if the NDC is empty.
NDC(const CFStringRef &message)
Add message onto the context stack.
static bool pop(std::wstring &dst)
Appends the current NDC content to the provided string and removes the value from the NDC.
static void remove()
Remove all the diagnostic context data for this thread.
static int getDepth()
Get the current nesting depth of this diagnostic context.
NDC(const std::string &message)
Add message onto the context stack.
static bool peek(CFStringRef &dst)
Append to dst the top value in the stack associated with the current thread without removing it.
static LogString peek()
Get the value at the top of the stack associated with the current thread without removing it.
static bool pop(std::basic_string< UniChar > &dst)
Append to dst the top value in the stack associated with the current thread and then remove it.
static bool get(LogString &dest)
Get the current value of the NDC of the currrent thread.
static bool peek(std::wstring &dst)
Append to dst the top value in the stack associated with the current thread without removing it.
static bool peek(std::string &buf)
Append to buf the top value in the stack associated with the current thread without removing it.
NDC(const std::wstring &message)
Add message onto the context stack.
const struct __CFString * CFStringRef
Definition: logstring.h:30
std::basic_string< logchar > LogString
Definition: logstring.h:60