9 #ifndef IMPKERNEL_CREATE_LOG_CONTEXT_H
10 #define IMPKERNEL_CREATE_LOG_CONTEXT_H
12 #include <IMP/kernel_config.h>
17 #if IMP_KERNEL_HAS_LOG4CXX
18 #include <log4cxx/ndc.h>
19 #include <boost/scoped_ptr.hpp>
22 IMPKERNEL_BEGIN_NAMESPACE
49 #if IMP_KERNEL_HAS_LOG4CXX
51 boost::scoped_ptr<log4cxx::NDC> ndc1_;
55 : ndc0_(object->get_quoted_name_c_string()),
56 ndc1_(
new log4cxx::NDC(fname)) {}
66 : pushed_(
true), name_(fname) {
68 push_log_context(name_.c_str(), object);
71 (
const char* fname,
const Object*
object =
nullptr), ,
72 { push_log_context(fname,
object);
74 {
if (pushed_) pop_log_context();
75 pushed_ =
false; }, );
81 IMPKERNEL_END_NAMESPACE
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
Temporarily change something; undo the change when this object is destroyed.
#define IMP_RAII(Name, args, Initialize, Set, Reset, Show)
Declares RAII-style methods in a class.
Provide a nullptr keyword analog.
Common base class for heavy weight IMP objects.
#define IMP_UNUSED(variable)
A shared base class to help in debugging and things.
Logging and error reporting support.
Create a new log context.
Macros to aid in writing RAII-style classes.