log4cpp
1.1.6
Toggle main menu visibility
Loading...
Searching...
No Matches
NDC.hh
Go to the documentation of this file.
1
/*
2
* NDC.hh
3
*
4
* Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5
* Copyright 2000, Bastiaan Bakker. All rights reserved.
6
*
7
* See the COPYING file for the terms of usage and distribution.
8
*/
9
10
#ifndef _LOG4CPP_NDC_HH
11
#define _LOG4CPP_NDC_HH
12
13
#include <
log4cpp/Portability.hh
>
14
#include <string>
15
#include <vector>
16
17
namespace
log4cpp
{
69
class
LOG4CPP_EXPORT
NDC
{
74
static
bool
isUsedNDC;
75
static
const
std::string emptyString;
76
77
public
:
78
struct
DiagnosticContext
{
79
DiagnosticContext
(
const
std::string&
message
);
80
DiagnosticContext
(
const
std::string&
message
,
const
DiagnosticContext
& parent);
81
82
std::string
message
;
83
std::string
fullMessage
;
84
};
85
86
typedef
std::vector<DiagnosticContext>
ContextStack
;
87
96
static
void
clear
();
97
111
static
ContextStack
*
cloneStack
();
112
117
static
const
std::string&
get
();
118
123
static
size_t
getDepth
();
124
125
static
void
inherit
(
ContextStack
* stack);
126
136
137
static
std::string
pop
();
138
147
static
void
push
(
const
std::string& message);
148
155
static
void
setMaxDepth
(
int
maxDepth);
156
161
static
NDC
&
getNDC
();
162
163
NDC
();
164
virtual
~NDC
();
165
166
public
:
167
virtual
void
_clear
();
168
virtual
ContextStack
*
_cloneStack
();
169
virtual
const
std::string&
_get
()
const
;
170
virtual
size_t
_getDepth
()
const
;
171
virtual
void
_inherit
(
ContextStack
* stack);
172
virtual
std::string
_pop
();
173
virtual
void
_push
(
const
std::string& message);
174
virtual
void
_setMaxDepth
(
int
maxDepth);
175
176
ContextStack
_stack
;
177
};
178
}
// namespace log4cpp
179
180
#endif
// _LOG4CPP_NDC_HH
LOG4CPP_EXPORT
#define LOG4CPP_EXPORT
Definition
Export.hh:26
Portability.hh
log4cpp::NDC::_stack
ContextStack _stack
Definition
NDC.hh:176
log4cpp::NDC::_cloneStack
virtual ContextStack * _cloneStack()
Definition
NDC.cpp:84
log4cpp::NDC::_pop
virtual std::string _pop()
Definition
NDC.cpp:102
log4cpp::NDC::pop
static std::string pop()
Clients should call this method before leaving a diagnostic context.
Definition
NDC.cpp:51
log4cpp::NDC::NDC
NDC()
Definition
NDC.cpp:76
log4cpp::NDC::setMaxDepth
static void setMaxDepth(int maxDepth)
Set the maximum nesting depth for the current NDC.
Definition
NDC.cpp:61
log4cpp::NDC::getDepth
static size_t getDepth()
Get the current nesting depth of this diagnostic context.
Definition
NDC.cpp:43
log4cpp::NDC::get
static const std::string & get()
Get the current diagnostic context string.
Definition
NDC.cpp:36
log4cpp::NDC::_clear
virtual void _clear()
Definition
NDC.cpp:80
log4cpp::NDC::_getDepth
virtual size_t _getDepth() const
Definition
NDC.cpp:94
log4cpp::NDC::getNDC
static NDC & getNDC()
Return the NDC for the current thread.
Definition
NDC.cpp:65
log4cpp::NDC::_setMaxDepth
virtual void _setMaxDepth(int maxDepth)
Definition
NDC.cpp:116
log4cpp::NDC::clear
static void clear()
Clear any nested disgnostic information if any.
Definition
NDC.cpp:28
log4cpp::NDC::push
static void push(const std::string &message)
Push new diagnostic context information for the current thread.
Definition
NDC.cpp:55
log4cpp::NDC::_inherit
virtual void _inherit(ContextStack *stack)
Definition
NDC.cpp:98
log4cpp::NDC::ContextStack
std::vector< DiagnosticContext > ContextStack
Definition
NDC.hh:86
log4cpp::NDC::_push
virtual void _push(const std::string &message)
Definition
NDC.cpp:108
log4cpp::NDC::inherit
static void inherit(ContextStack *stack)
Definition
NDC.cpp:47
log4cpp::NDC::cloneStack
static ContextStack * cloneStack()
Clone the diagnostic context for the current thread.
Definition
NDC.cpp:32
log4cpp::NDC::_get
virtual const std::string & _get() const
Definition
NDC.cpp:88
log4cpp
The top level namespace for all 'Log for C++' types and classes.
Definition
AbortAppender.hh:16
log4cpp::NDC::DiagnosticContext::DiagnosticContext
DiagnosticContext(const std::string &message)
Definition
NDC.cpp:16
log4cpp::NDC::DiagnosticContext::fullMessage
std::string fullMessage
Definition
NDC.hh:83
log4cpp::NDC::DiagnosticContext::message
std::string message
Definition
NDC.hh:82
include
log4cpp
NDC.hh
Generated by
1.17.0