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 | Private Member Functions | Private Attributes | List of all members
lsst::pex::logging::ScreenLog Class Reference

a Log configured to send messages to the screen. The BriefFormatter is used to format the messages. More...

#include <ScreenLog.h>

Inheritance diagram for lsst::pex::logging::ScreenLog:
lsst::pex::logging::Log lsst::pex::logging::DualLog

Public Member Functions

 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 ()
 
ScreenLogoperator= (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 ()
 
Logoperator= (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)
 
LogcreateChildLog (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 (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 LoggetDefaultLog ()
 
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 configure (bool verbose)
 

Private Attributes

LogDestination_screen
 
BriefFormatter_screenFrmtr
 

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 LogdefaultLog
 
static const std::string _sep
 

Detailed Description

a Log configured to send messages to the screen. The BriefFormatter is used to format the messages.

Definition at line 43 of file ScreenLog.h.

Constructor & Destructor Documentation

lsst::pex::logging::ScreenLog::ScreenLog ( bool  verbose = false,
int  threshold = Log::INFO 
)

create a Log that will write messages to a given file

Parameters
thresholdthe importance threshold to set for messages going to the screen.
verboseif 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::ScreenLog::ScreenLog ( const lsst::daf::base::PropertySet preamble,
bool  verbose = false,
int  threshold = Log::INFO 
)

create a Log that will write messages to a given file

Parameters
preamblea 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.
thresholdthe importance threshold to set for messages going to the screen.
verboseif 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::ScreenLog::ScreenLog ( const ScreenLog that)
inline

create a copy

Definition at line 76 of file ScreenLog.h.

77  : Log(that), _screen(that._screen), _screenFrmtr(that._screenFrmtr)
78  { }
LogDestination * _screen
Definition: ScreenLog.h:144
BriefFormatter * _screenFrmtr
Definition: ScreenLog.h:145
Log(const int threshold=INFO, const std::string &name="")
virtual lsst::pex::logging::ScreenLog::~ScreenLog ( )
virtual

delete this log

Member Function Documentation

void lsst::pex::logging::ScreenLog::configure ( bool  verbose)
private
static void lsst::pex::logging::ScreenLog::createDefaultLog ( bool  verbose = false,
int  threshold = Log::INFO 
)
static

create a new log and set it as the default Log

Parameters
thresholdthe importance threshold to set for messages going to the screen.
verboseif 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 void lsst::pex::logging::ScreenLog::createDefaultLog ( const lsst::daf::base::PropertySet preamble,
bool  verbose = false,
int  threshold = Log::INFO 
)
static

create a new log and set it as the default Log

Parameters
preamblea 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.
thresholdthe importance threshold to set for messages going to the screen.
verboseif 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.
int lsst::pex::logging::ScreenLog::getScreenThreshold ( )
inline

return the importance threshold current set for the screen

Definition at line 93 of file ScreenLog.h.

93 { return _screen->getThreshold(); }
LogDestination * _screen
Definition: ScreenLog.h:144
bool lsst::pex::logging::ScreenLog::isScreenVerbose ( )
inline

return true if all data properties will be printed to the screen or false if just the Log name ("LOG") and the text comment ("COMMENT") will be printed.

Definition at line 112 of file ScreenLog.h.

ScreenLog& lsst::pex::logging::ScreenLog::operator= ( const ScreenLog that)

copy another ScreenLog into this one

void lsst::pex::logging::ScreenLog::setScreenThreshold ( int  thresh)
inline

set the importance threshold current set for the screen

Definition at line 98 of file ScreenLog.h.

98 { _screen->setThreshold(thresh); }
LogDestination * _screen
Definition: ScreenLog.h:144
void lsst::pex::logging::ScreenLog::setScreenVerbose ( bool  printAll)
inline

set whether all data properties will be printed to the screen or just the Log name ("LOG") and the text comment ("COMMENT").

Parameters
printAlltrue if all properties should be printed.

Definition at line 105 of file ScreenLog.h.

105 { _screenFrmtr->setVerbose(printAll); }
BriefFormatter * _screenFrmtr
Definition: ScreenLog.h:145

Member Data Documentation

LogDestination* lsst::pex::logging::ScreenLog::_screen
private

Definition at line 144 of file ScreenLog.h.

BriefFormatter* lsst::pex::logging::ScreenLog::_screenFrmtr
private

Definition at line 145 of file ScreenLog.h.


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