LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Member Functions | Static Public Member Functions | List of all members
lsst::pex::logging::Trace Class Reference

limited backward compatibility to the DC2 run-time trace facilities More...

#include <Trace.h>

Public Member Functions

 Trace (const std::string &name, const int verbosity, const std::string &msg,...)
 
 Trace (const std::string &name, const int verbosity, const boost::format &msg)
 

Static Public Member Functions

static void setDestination (std::ostream &)
 set where logging is sent; ignored in new implementation More...
 
static void setVerbosity (const std::string &name)
 
static void setVerbosity (const std::string &name, const int verbosity)
 
static int getVerbosity (const std::string &name)
 
static void printVerbosity (std::ostream &out)
 
static void reset ()
 

Detailed Description

limited backward compatibility to the DC2 run-time trace facilities

This class replaces the original Trace facility and is provided for backward-compatibility. This fully in-lined implementation sends Trace calls to the logging framework.

Developers should prefer the use of DEBUG macros in available via Debug.h in the future which sends debugging messages through the logging framework.

From the original Trace.h (by Robert Lupton):

*      Tracing is controlled on a per "component" basis, where a "component" 
*      is a name of the form aaa.bbb.ccc where aaa is the Most significant 
*      part; for example, the utilities library might be called "utils", 
*      the doubly-linked list "utils.dlist", and the code to destroy a 
*      list "utils.dlist.del".
*
*      All tracing may be disabled by recompiling with LSST_NO_TRACE defined
*      to be non-zero
* 

Old Trace capabilities not supported were chose based on current use at the time this class was developed. These include

*   o  stream printing to Trace objects via << operator
*   o  TTrace templated functions
* 

Definition at line 93 of file Trace.h.

Constructor & Destructor Documentation

lsst::pex::logging::Trace::Trace ( const std::string &  name,
const int  verbosity,
const std::string &  msg,
  ... 
)
inline

Definition at line 155 of file Trace.h.

156  {}
lsst::pex::logging::Trace::Trace ( const std::string &  name,
const int  verbosity,
const boost::format &  msg 
)
inline

Definition at line 157 of file Trace.h.

158  {}

Member Function Documentation

static int lsst::pex::logging::Trace::getVerbosity ( const std::string &  name)
inlinestatic

Definition at line 178 of file Trace.h.

178  {
179  if (name.length() == 0 || name == ".")
180  return -1*Log::getDefaultLog().getThreshold();
181  else
183  }
table::Key< std::string > name
Definition: ApCorrMap.cc:71
int getThresholdFor(const std::string &name) const
int getThreshold() const
Definition: Log.h:281
static Log & getDefaultLog()
static void lsst::pex::logging::Trace::printVerbosity ( std::ostream &  out)
inlinestatic

Definition at line 184 of file Trace.h.

184  {
186  }
static Log & getDefaultLog()
void printThresholds(std::ostream &out)
Definition: Log.h:628
static void lsst::pex::logging::Trace::reset ( )
inlinestatic

Definition at line 187 of file Trace.h.

187  {
189  }
static Log & getDefaultLog()
static void lsst::pex::logging::Trace::setDestination ( std::ostream &  )
inlinestatic

set where logging is sent; ignored in new implementation

Definition at line 163 of file Trace.h.

163  {
164  }
static void lsst::pex::logging::Trace::setVerbosity ( const std::string &  name)
inlinestatic

Definition at line 166 of file Trace.h.

166  {
167  if (name.length() == 0 || name == ".")
169  else
171  }
table::Key< std::string > name
Definition: ApCorrMap.cc:71
static Log & getDefaultLog()
static const int INHERIT_THRESHOLD
Definition: Log.h:183
void setThresholdFor(const std::string &name, int threshold)
void setThreshold(int threshold)
Definition: Log.h:293
static void lsst::pex::logging::Trace::setVerbosity ( const std::string &  name,
const int  verbosity 
)
inlinestatic

Definition at line 172 of file Trace.h.

172  {
173  if (name.length() == 0 || name == ".")
174  Log::getDefaultLog().setThreshold(-1*verbosity);
175  else
176  Log::getDefaultLog().setThresholdFor(name, -1*verbosity);
177  }
table::Key< std::string > name
Definition: ApCorrMap.cc:71
static Log & getDefaultLog()
void setThresholdFor(const std::string &name, int threshold)
void setThreshold(int threshold)
Definition: Log.h:293

The documentation for this class was generated from the following file: