|
Apache Log4cxx
Version 1.5.0
|
Go to the documentation of this file.
18 #ifndef _LOG4CXX_NDC_H
19 #define _LOG4CXX_NDC_H
21 #include <log4cxx/log4cxx.h>
78 class 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
293 NDC& operator=(
const NDC&);
297 #endif // _LOG4CXX_NDC_H
std::basic_string< logchar > LogString
Definition: logstring.h:60
static void pushLS(const LogString &message)
Add message to the stack associated with the current thread.
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.
NDC(const std::string &message)
Add message onto the context stack.
const struct __CFString * CFStringRef
Definition: logstring.h:30
static LogString pop()
Get the value at the top of the stack associated with the current thread and then remove it.
static void push(const CFStringRef &message)
Add message to the stack associated with the current thread.
static void push(const std::string &message)
Add message to the stack associated with the current thread.
static LogString peek()
Get the value at the top of the stack associated with the current thread without removing it.
static void inherit(Stack *stack)
Inherit the diagnostic context of another thread.
NDC(const std::wstring &message)
Add message onto the context stack.
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 pop(std::wstring &dst)
Appends the current NDC content to the provided string and removes the value from the NDC.
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 peek(std::string &buf)
Append to buf the top value in the stack associated with the current thread without removing it.
std::stack< DiagnosticContext > Stack
Definition: ndc.h:85
static void push(const std::wstring &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(CFStringRef &dst)
Append to dst the top value in the stack associated with the current thread and then remove it.
static void push(const std::basic_string< UniChar > &message)
Add message to the stack associated with the current thread.
static void remove()
Remove all the diagnostic context data for this thread.
static bool empty()
Tests if the NDC is empty.
~NDC()
Remove the topmost element from the context stack associated with the current thread.
static const LogString & getFullMessage(const DiagnosticContext &ctx)
static bool peek(CFStringRef &dst)
Append to dst the top value in the stack associated with the current thread without removing it.
static const LogString & getMessage(const DiagnosticContext &ctx)
static int getDepth()
Get the current nesting depth of this diagnostic context.
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.
NDC(const std::basic_string< UniChar > &message)
Add message onto the context stack.
NDC(const CFStringRef &message)
Add message onto the context stack.
static Stack * cloneStack()
Clone the diagnostic context for the current thread.
A Nested Diagnostic Context, or NDC in short, is an instrument to distinguish interleaved log output ...
Definition: ndc.h:79