 |
log4cplus
2.0.5
|
Go to the documentation of this file.
26 #ifndef _LO4CPLUS_NDC_HEADER_
27 #define _LO4CPLUS_NDC_HEADER_
31 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
43 struct DiagnosticContext;
265 template <
typename StringType>
267 void push_worker (StringType
const &);
271 NDC& operator=(
const NDC&);
329 #endif // _LO4CPLUS_NDC_HEADER_
This class ensures that a NDC::push() call is always matched with a NDC::pop() call even in the face ...
void pop_void()
Same as pop() but without the return value.
std::basic_string< tchar > tstring
void remove()
Remove the diagnostic context for this thread.
void push(const log4cplus::tstring &message)
Push new diagnostic context information for the current thread.
log4cplus::tstring const & peek() const
Looks at the last diagnostic context at the top of this NDC without removing it.
DiagnosticContext(DiagnosticContext const &)
void clear()
Clear any nested diagnostic information if any.
DiagnosticContextStack cloneStack() const
Clone the diagnostic context for the current thread.
DiagnosticContext(tchar const *message, DiagnosticContext const *parent)
void inherit(const DiagnosticContextStack &stack)
Inherit the diagnostic context of another thread.
void swap(DiagnosticContext &)
~NDCContextCreator()
Pops the NDC stack.
void setMaxDepth(std::size_t maxDepth)
Set maximum depth of this diagnostic context.
This is the internal object that is stored on the NDC stack.
DiagnosticContext(DiagnosticContext &&)
The NDC class implements nested diagnostic contexts as defined by Neil Harrison in the article "Patte...
log4cplus::tstring pop()
Clients should call this method before leaving a diagnostic context.
log4cplus::tstring fullMessage
NDCContextCreator(const log4cplus::tstring &msg)
Pushes msg onto the NDC stack.
void push(tchar const *message)
NDCContextCreator(NDCContextCreator &&)=delete
DiagnosticContext(const log4cplus::tstring &message)
NDCContextCreator()=delete
DiagnosticContext(const log4cplus::tstring &message, DiagnosticContext const *parent)
DiagnosticContext(tchar const *message)
std::deque< DiagnosticContext > DiagnosticContextStack
NDCContextCreator(tchar const *msg)
log4cplus::tstring const & get() const
Used when printing the diagnostic context.
log4cplus::tstring message
NDCContextCreator(NDCContextCreator const &)=delete
#define LOG4CPLUS_PRIVATE
std::size_t getDepth() const
Get the current nesting depth of this diagnostic context.
LOG4CPLUS_EXPORT NDC & getNDC()
Return a reference to the singleton object.