LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Private Attributes | List of all members
lsst::pex::logging::LogRec Class Reference

A LogRecord attached to a particular Log that suppports stream stream semantics. More...

#include <Log.h>

Inheritance diagram for lsst::pex::logging::LogRec:
lsst::pex::logging::LogRecord

Public Types

enum  Manip { endr }
 

Public Member Functions

 LogRec (Log &log, int importance)
 
 LogRec (const LogRec &that)
 
virtual ~LogRec ()
 
LogRecoperator= (const LogRec &that)
 
LogRecoperator<< (const std::string &comment)
 
LogRecoperator<< (const boost::format &comment)
 
template<class T >
LogRecoperator<< (const RecordProperty< T > &prop)
 
LogRecoperator<< (const lsst::daf::base::PropertySet &props)
 
LogRecoperator<< (Manip signal)
 
- Public Member Functions inherited from lsst::pex::logging::LogRecord
 LogRecord (int threshold, int importance, bool showAll=false)
 
 LogRecord (int threshold, int importance, const lsst::daf::base::PropertySet &preamble, bool showAll=false)
 
 LogRecord (const LogRecord &that)
 
virtual ~LogRecord ()
 
LogRecordoperator= (const LogRecord &that)
 
void addComment (const std::string &comment)
 
void addComment (const boost::format &comment)
 
template<class T >
void addProperty (const RecordProperty< T > &property)
 
template<class T >
void addProperty (const std::string &name, const T &val)
 
void addProperties (const lsst::daf::base::PropertySet &props)
 
void addProperties (const lsst::daf::base::PropertySet::Ptr &props)
 
const
lsst::daf::base::PropertySet
getProperties () const
 
lsst::daf::base::PropertySetgetProperties ()
 
const
lsst::daf::base::PropertySet
data () const
 
lsst::daf::base::PropertySetdata ()
 
size_t countParamNames ()
 
size_t countParamValues () const
 
int getImportance () const
 
bool willRecord () const
 
bool willShowAll () const
 
void setShowAll (bool yesno)
 
void setTimestamp ()
 
virtual void setDate ()
 

Private Attributes

bool _sent
 
Log_log
 

Additional Inherited Members

- Static Public Member Functions inherited from lsst::pex::logging::LogRecord
static long long utcnow ()
 
- Protected Member Functions inherited from lsst::pex::logging::LogRecord
 LogRecord ()
 
void _init ()
 
- Protected Attributes inherited from lsst::pex::logging::LogRecord
bool _send
 
bool _showAll
 
int _vol
 
lsst::daf::base::PropertySet::Ptr _data
 

Detailed Description

A LogRecord attached to a particular Log that suppports stream stream semantics.

Definition at line 729 of file Log.h.

Member Enumeration Documentation

Record manipulators. These values may be sent to this LogRec via the output operator to request a particular manipulation of the message.

Enumerator
endr 

a manipulator indicating that the message is complete and should be sent to the Log.

Definition at line 769 of file Log.h.

769  {
774  endr
775  };

Constructor & Destructor Documentation

lsst::pex::logging::LogRec::LogRec ( Log log,
int  importance 
)
inline

Create a log record to be sent to a given log.

Parameters
logthe log this record should be written to
importancethe urgency of the record. If this value is greater than or equal to the Log's importance threshold, the message will be recorded.

Definition at line 739 of file Log.h.

740  : LogRecord(log.getThreshold(), importance, log.getPreamble()),
741  _sent(false), _log(&log)
742  { }
def log
Definition: log.py:85
lsst::pex::logging::LogRec::LogRec ( const LogRec that)
inline

create a copy

Definition at line 747 of file Log.h.

748  : LogRecord(that), _sent(false), _log(that._log)
749  { }
virtual lsst::pex::logging::LogRec::~LogRec ( )
virtual

delete this record

Member Function Documentation

LogRec& lsst::pex::logging::LogRec::operator<< ( const std::string &  comment)

record a string comment into this message

LogRec& lsst::pex::logging::LogRec::operator<< ( const boost::format &  comment)
inline

record a string comment into this message

Definition at line 788 of file Log.h.

788  {
789  addComment(comment);
790  return *this;
791  }
void addComment(const std::string &comment)
Definition: LogRecord.h:165
template<class T >
LogRec& lsst::pex::logging::LogRec::operator<< ( const RecordProperty< T > &  prop)
inline

record a data property into this message

Definition at line 797 of file Log.h.

797  {
798  addProperty(prop.name, prop.value);
799  return *this;
800  }
void addProperty(const RecordProperty< T > &property)
Definition: LogRecord.h:327
LogRec& lsst::pex::logging::LogRec::operator<< ( const lsst::daf::base::PropertySet props)
inline

record a data property into this message

Definition at line 805 of file Log.h.

805  {
806  addProperties(props);
807  return *this;
808  }
void addProperties(const lsst::daf::base::PropertySet &props)
LogRec& lsst::pex::logging::LogRec::operator<< ( Manip  signal)
inline

receive a message manipulator signal. The most common use of this version is to indicate that the Record is now complete and should be flushed to the Log.

Parameters
signalthe manipulator signal value (e.g. LogRec::endr).

Definition at line 816 of file Log.h.

816  {
817  if (_send) {
818  switch (signal) {
819  case endr:
820  _log->send(*this);
821  _sent = true;
822  break;
823  default:
824  ;
825  }
826  }
827  return *this;
828  }
void send(const LogRecord &record)
LogRec& lsst::pex::logging::LogRec::operator= ( const LogRec that)
inline

copy another record into this one

Definition at line 759 of file Log.h.

759  {
760  LogRecord::operator=(that);
761  _log = that._log;
762  return *this;
763  }
LogRecord & operator=(const LogRecord &that)
Definition: LogRecord.h:151

Member Data Documentation

Log* lsst::pex::logging::LogRec::_log
private

Definition at line 832 of file Log.h.

bool lsst::pex::logging::LogRec::_sent
private

Definition at line 831 of file Log.h.


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