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
|
a container for constructing a single Log record More...
#include <LogRecord.h>
Public Member Functions | |
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 () |
LogRecord & | operator= (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::PropertySet & | getProperties () |
const lsst::daf::base::PropertySet & | data () const |
lsst::daf::base::PropertySet & | data () |
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 () |
Static Public Member Functions | |
static long long | utcnow () |
Protected Member Functions | |
LogRecord () | |
void | _init () |
Protected Attributes | |
bool | _send |
bool | _showAll |
int | _vol |
lsst::daf::base::PropertySet::Ptr | _data |
a container for constructing a single Log record
The purpose of this class is to collect data for inclusion in a message to a Log.
Definition at line 99 of file LogRecord.h.
lsst::pex::logging::LogRecord::LogRecord | ( | int | threshold, |
int | importance, | ||
bool | showAll = false |
||
) |
Create a log record to be sent to a given log. The current time is recorded and set as the DATE property.
threshold | the importance threshold that determines if a message is printed. |
importance | the loudness of the record. If this value is greater than or equal to the given importance threshold, the message will be recorded. |
showAll | if true, prefer showing all properties when rendering this record. The default is false. (See willShow().) |
lsst::pex::logging::LogRecord::LogRecord | ( | int | threshold, |
int | importance, | ||
const lsst::daf::base::PropertySet & | preamble, | ||
bool | showAll = false |
||
) |
Create a log record to be sent to a given log. The current time is recorded and set as the DATE property.
threshold | the importance threshold that determines if a message is printed. |
importance | the loudness of the record. If this value is greater than or equal to the given importance threshold, the message will be recorded. |
preamble | an ordered set of properties that constitute the preamble of this message. This should not include the current time. |
showAll | if true, prefer showing all properties when rendering this record. The default is false. (See willShowAll().) |
|
inline |
create a copy of a record
Definition at line 137 of file LogRecord.h.
|
virtual |
delete this log record
|
inlineprotected |
Definition at line 308 of file LogRecord.h.
|
inlineprotected |
initialize this record with the DATE and LEVEL properties
Definition at line 313 of file LogRecord.h.
|
inline |
add a string comment to this record. The comment will get stored in the data property under the key name, "COMMENT". The comment will only get added when willRecord() is returns true which is set when the record is constructed (usually by a Log object).
Definition at line 165 of file LogRecord.h.
|
inline |
add a string comment to this record. This version is provided as a convenience and is equivalent to addComment(comment.str()).
Definition at line 173 of file LogRecord.h.
void lsst::pex::logging::LogRecord::addProperties | ( | const lsst::daf::base::PropertySet & | props | ) |
add all of the properties found in the given PropertySet. This will make sure not to overwrite critical properties, LEVEL, LOG, TIMESTAMP, and DATE.
|
inline |
add all of the properties found in the given PropertySet. This will make sure not to overwrite critical properties, LEVEL, LOG, TIMESTAMP, and DATE.
Definition at line 201 of file LogRecord.h.
void lsst::pex::logging::LogRecord::addProperty | ( | const RecordProperty< T > & | property | ) |
attach a named item of data to this record.
Definition at line 327 of file LogRecord.h.
void lsst::pex::logging::LogRecord::addProperty | ( | const std::string & | name, |
const T & | val | ||
) |
attach a named item of data to this record.
Definition at line 332 of file LogRecord.h.
|
inline |
return the number available property parameter names (i.e. ones that return non-PropertySet values).
Definition at line 233 of file LogRecord.h.
size_t lsst::pex::logging::LogRecord::countParamValues | ( | ) | const |
return the total number of data property values currently contained in this log record. This function will sum the number values associated with a name, summed over all available names (including subproperties). This total does not include PropertySet values.
|
inline |
return the data properties that make up this log message. This is a synonym for getProperties().
Definition at line 221 of file LogRecord.h.
|
inline |
return the data properties that make up this log message. This is a synonym for getProperties().
Definition at line 227 of file LogRecord.h.
|
inline |
return the importance level–a measure of "loudness"–associated with this record.
Definition at line 250 of file LogRecord.h.
|
inline |
return the read-only data properties that make up this log message. This is a synonym for data().
Definition at line 209 of file LogRecord.h.
|
inline |
return the data properties that make up this log message. This is a synonym for data().
Definition at line 215 of file LogRecord.h.
copy another record into this one.
Definition at line 151 of file LogRecord.h.
|
virtual |
set the DATE property to the current value of the TIMESTAMP property. The value is a string representation of the TIMESTAMP property, formatted for read-able display.
Unlike setTimestamp(), this function is not called automatically within the LogRecord constructor; thus, a user of this class must call it explicitly to have this property.
This function is intended for use by a Log class that sets the value just before sending this record to the LogDestinations.
|
inline |
set whether all of the properties attached to this record should be displayed when the record is rendered. A LogFormatter may or may not choose to honor the preference, according to the purposes of its implmentation.
yesno | the preference for showing all. willShowAll() will return this value. |
Definition at line 275 of file LogRecord.h.
void lsst::pex::logging::LogRecord::setTimestamp | ( | ) |
set the TIMESTAMP property to the current time. The value is stored as a lsst::daf::base::DateTime instance.
This is called automatically in the constructor, but it can be reset at any time. If there is also a DATE property, it will be updated as well (see setDate()).
|
static |
return the current UTC time in nanosecs since Jan 1, 1970. This value is suitable for passing to a DateTime constructor.
|
inline |
return true if the importance level is set loud enough to cause this record to be actually recorded. This value is set at construction time only.
Definition at line 257 of file LogRecord.h.
|
inline |
return true if there is a preference by the creator of this record to show all the properties associated with this record. A LogFormatter may or may not choose to honor this preference when this LogRecord is rendered.
Definition at line 265 of file LogRecord.h.
|
protected |
Definition at line 323 of file LogRecord.h.
|
protected |
Definition at line 320 of file LogRecord.h.
|
protected |
Definition at line 321 of file LogRecord.h.
|
protected |
Definition at line 322 of file LogRecord.h.