33 #if !defined(LSST_PEX_LOGGING_TRACE_H)
34 #define LSST_PEX_LOGGING_TRACE_H 1
41 #include <boost/format.hpp>
49 #ifndef LSST_DEBUGGING_ON
50 #define LSST_NO_TRACE 1
53 #if !defined(LSST_NO_TRACE)
54 # define LSST_NO_TRACE 0
57 #if !defined(LSST_MAX_TRACE)
58 # define LSST_MAX_TRACE -1
106 const std::string fmt,
113 const int len = vsnprintf(NULL, 0, fmt.c_str(), ap) + 1;
118 (void)vsnprintf(msg, len, fmt.c_str(), ap);
122 out.
debug(verbosity, msg);
126 Trace(
const std::string& name,
133 out.
debug(verbosity, msg);
140 Trace(
const std::string& name,
147 out.
debug(verbosity, msg.str());
155 Trace(
const std::string& name,
const int verbosity,
156 const std::string& msg, ...) {}
157 Trace(
const std::string& name,
const int verbosity,
167 if (name.length() == 0 || name ==
".")
172 static void setVerbosity(
const std::string &name,
const int verbosity) {
173 if (name.length() == 0 || name ==
".")
179 if (name.length() == 0 || name ==
".")
192 template<
int VERBOSITY>
202 const int len = vsnprintf(NULL, 0, fmt, ap) + 1;
207 (void)vsnprintf(msg, len, fmt, ap);
210 Trace(name, VERBOSITY, msg);
214 template<
int VERBOSITY>
216 const std::string fmt,
222 Trace(name, VERBOSITY, fmt, ap);
231 #endif // end LSST_PEX_LOGGING_TRACE_H
static void setVerbosity(const std::string &name, const int verbosity)
table::Key< std::string > name
int getThresholdFor(const std::string &name) const
#define LSST_MAX_TRACE
Maximum level to trace (only works for TTrace)
static void setVerbosity(const std::string &name)
limited backward compatibility to the DC2 run-time trace facilities
Trace(const std::string &name, const int verbosity, const std::string &msg,...)
static Log & getDefaultLog()
static void printVerbosity(std::ostream &out)
static const int INHERIT_THRESHOLD
void printThresholds(std::ostream &out)
Trace(const std::string &name, const int verbosity, const boost::format &msg)
static int getVerbosity(const std::string &name)
void setThresholdFor(const std::string &name, int threshold)
void debug(int verbosity, const std::string &message)
static void setDestination(std::ostream &)
set where logging is sent; ignored in new implementation
void TTrace(const char *name, const char *fmt,...)
void setThreshold(int threshold)
definition of the Debug class and macros