ac23379b06c13ed5252a11610a104ddde8b50bde
[shibboleth/cpp-xmltooling.git] / xmltooling / util / NDC.cpp
1 /*
2  *  Copyright 2001-2007 Internet2
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * NDC.cpp
19  * 
20  * Diagnostic context for logging 
21  */
22
23 #include "internal.h"
24 #include "logging.h"
25 #include "util/NDC.h"
26
27 #if defined(XMLTOOLING_LOG4SHIB)
28 # include <log4shib/NDC.hh>
29 #elif defined(XMLTOOLING_LOG4CPP)
30 # include <log4cpp/NDC.hh>
31 #endif
32
33 using namespace xmltooling;
34
35 NDC::NDC(const char* context)
36 {
37     logging::NDC::push(context);
38 }
39
40 NDC::NDC(const std::string& context)
41 {
42     logging::NDC::push(context);
43 }
44
45 NDC::~NDC()
46 {
47     logging::NDC::pop();
48 }