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
|
a Log that sends message to both the screen and a file. More...
#include <DualLog.h>
Public Member Functions | |
DualLog (const lsst::daf::base::PropertySet &preamble, const std::string &filename, int filethresh=0, int screenthresh=0, bool screenVerbose=false) | |
DualLog (const std::string &filename, int filethresh=0, int screenthresh=0, bool screenVerbose=false) | |
DualLog (const DualLog &that) | |
virtual | ~DualLog () |
DualLog & | operator= (const DualLog &that) |
int | getFileThreshold () |
void | setFileThreshold (int thresh) |
Public Member Functions inherited from lsst::pex::logging::ScreenLog | |
ScreenLog (bool verbose=false, int threshold=Log::INFO) | |
ScreenLog (const lsst::daf::base::PropertySet &preamble, bool verbose=false, int threshold=Log::INFO) | |
ScreenLog (const ScreenLog &that) | |
virtual | ~ScreenLog () |
ScreenLog & | operator= (const ScreenLog &that) |
int | getScreenThreshold () |
void | setScreenThreshold (int thresh) |
void | setScreenVerbose (bool printAll) |
bool | isScreenVerbose () |
Public Member Functions inherited from lsst::pex::logging::Log | |
Log (const int threshold=INFO, const std::string &name="") | |
Log (const std::list< boost::shared_ptr< LogDestination > > &destinations, const lsst::daf::base::PropertySet &preamble, const std::string &name="", const int threshold=INFO, bool defaultShowAll=false) | |
Log (const Log &parent, const std::string &childName, int threshold=INHERIT_THRESHOLD) | |
Log (const Log &that) | |
virtual | ~Log () |
Log & | operator= (const Log &that) |
const std::string & | getName () const |
int | getThreshold () const |
void | setThreshold (int threshold) |
bool | sends (int importance) const |
void | resetThreshold () |
void | setThresholdFor (const std::string &name, int threshold) |
int | getThresholdFor (const std::string &name) const |
bool | willShowAll () const |
void | setShowAll (bool yesno) |
void | resetShowAll () |
template<class T > | |
void | addPreambleProperty (const std::string &name, const T &val) |
template<class T > | |
void | setPreambleProperty (const std::string &name, const T &val) |
Log * | createChildLog (const std::string &childName, int threshold=INHERIT_THRESHOLD) const |
void | log (int importance, const std::string &message, const lsst::daf::base::PropertySet &properties) |
template<class T > | |
void | log (int importance, const std::string &message, const std::string &name, const T &val) |
template<class T > | |
void | log (int importance, const std::string &message, const RecordProperty< T > &prop) |
void | log (int importance, const std::string &message) |
void | log (int importance, const boost::format &message) |
void | logdebug (const std::string &message, const lsst::daf::base::PropertySet &properties) |
template<class T > | |
void | logdebug (const std::string &message, const std::string &name, const T &val) |
template<class T > | |
void | logdebug (const std::string &message, const RecordProperty< T > &prop) |
void | logdebug (const std::string &message) |
void | logdebug (const boost::format &message) |
void | info (const std::string &message, const lsst::daf::base::PropertySet &properties) |
template<class T > | |
void | info (const std::string &message, const std::string &name, const T &val) |
template<class T > | |
void | info (const std::string &message, const RecordProperty< T > &prop) |
void | info (const std::string &message) |
void | info (const boost::format &message) |
void | warn (const std::string &message, const lsst::daf::base::PropertySet &properties) |
template<class T > | |
void | warn (const std::string &message, const std::string &name, const T &val) |
template<class T > | |
void | warn (const std::string &message, const RecordProperty< T > &prop) |
void | warn (const std::string &message) |
void | warn (const boost::format &message) |
void | fatal (const std::string &message, const lsst::daf::base::PropertySet &properties) |
template<class T > | |
void | fatal (const std::string &message, const std::string &name, const T &val) |
template<class T > | |
void | fatal (const std::string &message, const RecordProperty< T > &prop) |
void | fatal (const std::string &message) |
void | fatal (const boost::format &message) |
void | format (int importance, const char *fmt,...) |
void | debugf (const char *fmt,...) |
void | infof (const char *fmt,...) |
void | warnf (const char *fmt,...) |
void | fatalf (const char *fmt,...) |
void | send (const LogRecord &record) |
void | addDestination (std::ostream &destination, int threshold) |
void | addDestination (std::ostream &destination, int threshold, const boost::shared_ptr< LogFormatter > &formatter) |
void | addDestination (const boost::shared_ptr< LogDestination > &destination) |
const lsst::daf::base::PropertySet & | getPreamble () |
void | markPersistent () |
void | printThresholds (std::ostream &out) |
void | reset () |
Static Public Member Functions | |
static void | createDefaultLog (const lsst::daf::base::PropertySet &preamble, const std::string &filename, int filethresh=Log::INHERIT_THRESHOLD, int screenthresh=0, bool screenVerbose=false) |
static void | createDefaultLog (const std::string &filename, int filethresh=Log::INHERIT_THRESHOLD, int screenthresh=0, bool screenVerbose=false) |
Static Public Member Functions inherited from lsst::pex::logging::ScreenLog | |
static void | createDefaultLog (bool verbose=false, int threshold=Log::INFO) |
static void | createDefaultLog (const lsst::daf::base::PropertySet &preamble, bool verbose=false, int threshold=Log::INFO) |
Static Public Member Functions inherited from lsst::pex::logging::Log | |
static Log & | getDefaultLog () |
static void | createDefaultLog (const std::list< boost::shared_ptr< LogDestination > > &destinations, const lsst::daf::base::PropertySet &preamble, const std::string &name="", const int threshold=INFO) |
static void | closeDefaultLog () |
Private Member Functions | |
void | _init (const std::string &filename, int filethresh) |
Private Attributes | |
LogDestination * | _file |
std::ofstream * | fstrm |
Additional Inherited Members | |
Static Public Attributes inherited from lsst::pex::logging::Log | |
static const int | DEBUG |
static const int | INFO |
static const int | WARN |
static const int | INHERIT_THRESHOLD |
static const int | FATAL |
Protected Member Functions inherited from lsst::pex::logging::Log | |
void | _send (int threshold, int importance, const char *fmt, va_list ap) |
void | _format (int importance, const char *fmt, va_list ap) |
Static Protected Member Functions inherited from lsst::pex::logging::Log | |
static void | setDefaultLog (Log *deflog) |
Protected Attributes inherited from lsst::pex::logging::Log | |
boost::shared_ptr < threshold::Memory > | _thresholds |
std::list< boost::shared_ptr < LogDestination > > | _destinations |
lsst::daf::base::PropertySet::Ptr | _preamble |
Static Protected Attributes inherited from lsst::pex::logging::Log | |
static Log * | defaultLog |
static const std::string | _sep |
a Log that sends message to both the screen and a file.
This class uses the BriefFormatter for printing to the screen (via cout) and the NetLoggerFormatter for the file. This class provides an interface for controlling the amount printed to the screen (setPrintAllProps()) as well as the thresholds on the individual destinations.
lsst::pex::logging::DualLog::DualLog | ( | const lsst::daf::base::PropertySet & | preamble, |
const std::string & | filename, | ||
int | filethresh = 0 , |
||
int | screenthresh = 0 , |
||
bool | screenVerbose = false |
||
) |
create a Log that will write messages to a given file
preamble | a list of data properties that should be included with every recorded message to the Log. This constructor will automatically add a property ("LOG") giving the Log name. |
filename | the name of the file to send messages to. It will be opened in append mode. |
filethresh | the importance threshold to set for the log file |
screenthresh | the importance threshold to set for messages going to the screen. |
screenVerbose | if true, all message data properties will be printed to the screen. If false, only the Log name ("LOG") and the text comment ("COMMENT") will be printed. |
lsst::pex::logging::DualLog::DualLog | ( | const std::string & | filename, |
int | filethresh = 0 , |
||
int | screenthresh = 0 , |
||
bool | screenVerbose = false |
||
) |
create a Log that will write messages to a given file
filename | the name of the file to send messages to. It will be opened in append mode. |
filethresh | the importance threshold to set for the log file |
screenthresh | the importance threshold to set for messages going to the screen. |
screenVerbose | if true, all message data properties will be printed to the screen. If false, only the Log name ("LOG") and the text comment ("COMMENT") will be printed. |
|
inline |
|
virtual |
delete this log
|
private |
|
static |
create a new log and set it as the default Log
preamble | a list of data properties that should be included with every recorded message to the Log. This constructor will automatically add a property ("LOG") giving the Log name. |
filename | the name of the file to send messages to. It will be opened in append mode. |
filethresh | the importance threshold to set for the log file |
screenthresh | the importance threshold to set for messages going to the screen. |
screenVerbose | if true, all message data properties will be printed to the screen. If false, only the Log name ("LOG") and the text comment ("COMMENT") will be printed. |
|
static |
create a new log and set it as the default Log
filename | the name of the file to send messages to. It will be opened in append mode. |
filethresh | the importance threshold to set for the log file |
screenthresh | the importance threshold to set for messages going to the screen. |
screenVerbose | if true, all message data properties will be printed to the screen. If false, only the Log name ("LOG") and the text comment ("COMMENT") will be printed. |
|
inline |
return the importance threshold current set for the log file. This applies only to the file stream set at construction time.
Definition at line 113 of file DualLog.h.
|
inline |
set the importance threshold current set for the log file. This only affects the file stream set at construction time; other subsequently added streams are unaffected.
Definition at line 120 of file DualLog.h.
|
private |