#include <LogStream.hh>

The stream operators are overloaded so that the LogStream can be used similarly to std::cout.
The manipulator LOG::done should be used to terminate a log message.
Some of the code, particularly the handling of ios manipulators, is based on Gaudi's MsgStream class.
Definition at line 62 of file LogStream.hh.
Public Member Functions | |
| LogStream (const std::string &name, LOG::ELevel level, ostream *os=&std::cout) | |
| LogStream () | |
| virtual | ~LogStream () |
| const std::string & | getName () const |
| bool | isActive () const |
| LOG::ELevel | getOutputLevel () const |
| ostream & | getOutputStream () const |
| void | setOutputLevel (const LOG::ELevel &outputLevel) |
| LogStream & | operator<< (const LOG::ELevel &x) |
| LogStream & | operator<< (const LOG::EManip &x) |
| LogStream & | operator<< (const std::_Setiosflags &manip) |
| LogStream & | operator<< (const std::_Resetiosflags &manip) |
| LogStream & | operator<< (const std::_Setbase &manip) |
| LogStream & | operator<< (const std::_Setprecision &manip) |
| LogStream & | operator<< (const std::_Setw &manip) |
| LogStream & | operator<< (ios &(*manip)(std::ios &)) |
| LogStream & | operator<< (std::ios_base &(*manip)(std::ios_base &)) |
| template<typename T> | |
| LogStream & | operator<< (const T &arg) |
| template<typename T> | |
| LogStream & | operator<< (const std::vector< T > &v) |
| int | width () const |
| int | width (int v) |
| long | flags () const |
| long | flags (std::ios_base::fmtflags v) |
| long | setf (std::ios_base::fmtflags v) |
| char | fill () const |
| char | fill (char v) |
| int | precision () const |
| int | precision (int v) |
| int | rdstate () const |
| int | good () const |
| int | eof () const |
| int | bad () const |
| long | setf (std::ios_base::fmtflags _f, std::ios_base::fmtflags _m) |
| void | unsetf (std::ios_base::fmtflags _l) |
| void | clear (std::ios_base::iostate _i=std::ios_base::failbit) |
| void | setOutputFile (const std::string &file) |
| LogStream & | debug () |
| LogStream & | verbose () |
| LogStream & | okay () |
| LogStream & | warning () |
| LogStream & | error () |
| LogStream & | fatal () |
| LogStream & | always () |
| void | log (const std::string &mesg, const LOG::ELevel &level) |
| void | log (const std::string &mesg) |
| void | debug (const std::string &mesg) |
| void | verbose (const std::string &mesg) |
| void | okay (const std::string &mesg) |
| void | warning (const std::string &mesg) |
| void | error (const std::string &mesg) |
| void | fatal (const std::string &mesg) |
| void | always (const std::string &mesg) |
Private Attributes | |
| std::string | m_name |
| LOG::ELevel | m_outputLevel |
| ostream * | m_os |
| LOG::ELevel | m_defaultOutputLevel |
| bool | m_active |
| std::ofstream * | m_fos |
| LogMessenger * | m_messenger |
| slic::LogStream::LogStream | ( | const std::string & | name, | |
| LOG::ELevel | level, | |||
| ostream * | os = &std::cout | |||
| ) | [inline] |
| slic::LogStream::LogStream | ( | ) | [inline] |
Definition at line 80 of file LogStream.hh.
| virtual slic::LogStream::~LogStream | ( | ) | [inline, virtual] |
Definition at line 90 of file LogStream.hh.
| const std::string& slic::LogStream::getName | ( | ) | const [inline] |
Definition at line 96 of file LogStream.hh.
References m_name.
Referenced by slic::LogMessenger::defineCommands(), and operator<<().
| bool slic::LogStream::isActive | ( | ) | const [inline] |
Definition at line 101 of file LogStream.hh.
References m_active.
Referenced by bad(), clear(), eof(), fill(), flags(), good(), operator<<(), precision(), rdstate(), setf(), unsetf(), and width().
| LOG::ELevel slic::LogStream::getOutputLevel | ( | ) | const [inline] |
Definition at line 106 of file LogStream.hh.
References m_outputLevel.
Referenced by log(), and operator<<().
| ostream& slic::LogStream::getOutputStream | ( | ) | const [inline] |
Definition at line 111 of file LogStream.hh.
References m_os.
Referenced by bad(), clear(), slic::LcioMcpPrinter::colLabels(), eof(), fill(), flags(), good(), operator<<(), precision(), slic::LcioMcpPrinter::printMcp(), slic::CommandLineProcessor::printOptions(), rdstate(), setf(), unsetf(), and width().
| void slic::LogStream::setOutputLevel | ( | const LOG::ELevel & | outputLevel | ) | [inline] |
Definition at line 116 of file LogStream.hh.
References m_outputLevel.
Referenced by slic::LogMessenger::SetNewValue().
| LogStream& slic::LogStream::operator<< | ( | const LOG::ELevel & | x | ) | [inline] |
Stream the level of this message.
Definition at line 124 of file LogStream.hh.
References getOutputLevel(), m_active, and m_outputLevel.
| LogStream& slic::LogStream::operator<< | ( | const LOG::EManip & | x | ) | [inline] |
Definition at line 143 of file LogStream.hh.
References LOG::done, LOG::endl, TimeUtil::getAscTime(), getName(), getOutputLevel(), getOutputStream(), LOG::head, isActive(), levelNames, m_defaultOutputLevel, and m_outputLevel.
| LogStream& slic::LogStream::operator<< | ( | const std::_Setiosflags & | manip | ) | [inline] |
| LogStream& slic::LogStream::operator<< | ( | const std::_Resetiosflags & | manip | ) | [inline] |
| LogStream& slic::LogStream::operator<< | ( | const std::_Setbase & | manip | ) | [inline] |
| LogStream& slic::LogStream::operator<< | ( | const std::_Setprecision & | manip | ) | [inline] |
| LogStream& slic::LogStream::operator<< | ( | const std::_Setw & | manip | ) | [inline] |
| LogStream& slic::LogStream::operator<< | ( | ios &(*)(std::ios &) | manip | ) | [inline] |
| LogStream& slic::LogStream::operator<< | ( | std::ios_base &(*)(std::ios_base &) | manip | ) | [inline] |
| LogStream& slic::LogStream::operator<< | ( | const T & | arg | ) | [inline] |
| LogStream& slic::LogStream::operator<< | ( | const std::vector< T > & | v | ) | [inline] |
| int slic::LogStream::width | ( | ) | const [inline] |
Definition at line 242 of file LogStream.hh.
References getOutputStream(), and isActive().
Referenced by slic::PhysicsListFactory::printAvailableLists().
| int slic::LogStream::width | ( | int | v | ) | [inline] |
| long slic::LogStream::flags | ( | ) | const [inline] |
| long slic::LogStream::flags | ( | std::ios_base::fmtflags | v | ) | [inline] |
| long slic::LogStream::setf | ( | std::ios_base::fmtflags | v | ) | [inline] |
| char slic::LogStream::fill | ( | ) | const [inline] |
| char slic::LogStream::fill | ( | char | v | ) | [inline] |
| int slic::LogStream::precision | ( | ) | const [inline] |
| int slic::LogStream::precision | ( | int | v | ) | [inline] |
| int slic::LogStream::rdstate | ( | ) | const [inline] |
| int slic::LogStream::good | ( | ) | const [inline] |
| int slic::LogStream::eof | ( | ) | const [inline] |
| int slic::LogStream::bad | ( | ) | const [inline] |
| long slic::LogStream::setf | ( | std::ios_base::fmtflags | _f, | |
| std::ios_base::fmtflags | _m | |||
| ) | [inline] |
| void slic::LogStream::unsetf | ( | std::ios_base::fmtflags | _l | ) | [inline] |
| void slic::LogStream::clear | ( | std::ios_base::iostate | _i = std::ios_base::failbit |
) | [inline] |
| void slic::LogStream::setOutputFile | ( | const std::string & | file | ) | [inline] |
| LogStream& slic::LogStream::debug | ( | ) | [inline] |
Definition at line 335 of file LogStream.hh.
References LOG::debug.
Referenced by slic::LcioHitsCollectionBuilder::createHitCollections(), and slic::SlicApplication::~SlicApplication().
| LogStream& slic::LogStream::verbose | ( | ) | [inline] |
Definition at line 340 of file LogStream.hh.
References LOG::verbose.
Referenced by slic::Module::Module(), slic::SlicApplication::run(), slic::LcioHitsCollectionBuilder::setLongFlag(), slic::LcioHitsCollectionBuilder::setPDGFlag(), slic::LcioManager::setRunNumber(), and slic::Module::~Module().
| LogStream& slic::LogStream::okay | ( | ) | [inline] |
Definition at line 345 of file LogStream.hh.
References LOG::okay.
Referenced by slic::PhysicsListFactory::create(), slic::SlicApplication::initialize(), slic::PhysicsListManager::initializePhysicsList(), slic::LcioManager::makeAutoname(), slic::LcioManager::openLcioFile(), slic::StdHepLoader::openStdHepFile(), slic::PhysicsListManager::setCurrentListName(), slic::LcioManager::setDetectorName(), and slic::EventSourceManager::setupEventSource().
| LogStream& slic::LogStream::warning | ( | ) | [inline] |
Definition at line 350 of file LogStream.hh.
References LOG::warning.
Referenced by slic::EventAction::BeginOfEventAction(), slic::SlicApplication::initialize(), slic::LcioManager::makeAutoname(), slic::ModuleRegistry::registerModule(), and slic::EventSourceManager::setupEventSource().
| LogStream& slic::LogStream::error | ( | ) | [inline] |
Definition at line 355 of file LogStream.hh.
References LOG::error.
Referenced by slic::LcioHitsCollectionBuilder::addMcpContribs(), slic::LcioHitsCollectionBuilder::createHit(), slic::StdHepLoader::dumpCurrentEvent(), slic::PhysicsListManager::initializePhysicsList(), slic::LcioManager::openLcioFile(), and slic::EventSourceManager::setupEventSource().
| LogStream& slic::LogStream::fatal | ( | ) | [inline] |
Definition at line 360 of file LogStream.hh.
References LOG::fatal.
Referenced by slic::SlicApplication::initializeUI(), slic::LcioManager::openLcioFile(), and slic::StdHepLoader::readNextEvent().
| LogStream& slic::LogStream::always | ( | ) | [inline] |
Definition at line 365 of file LogStream.hh.
References LOG::always.
Referenced by slic::SlicApplication::initialize().
| void slic::LogStream::log | ( | const std::string & | mesg, | |
| const LOG::ELevel & | level | |||
| ) | [inline] |
| void slic::LogStream::log | ( | const std::string & | mesg | ) | [inline] |
| void slic::LogStream::debug | ( | const std::string & | mesg | ) | [inline] |
| void slic::LogStream::verbose | ( | const std::string & | mesg | ) | [inline] |
| void slic::LogStream::okay | ( | const std::string & | mesg | ) | [inline] |
| void slic::LogStream::warning | ( | const std::string & | mesg | ) | [inline] |
| void slic::LogStream::error | ( | const std::string & | mesg | ) | [inline] |
| void slic::LogStream::fatal | ( | const std::string & | mesg | ) | [inline] |
| void slic::LogStream::always | ( | const std::string & | mesg | ) | [inline] |
std::string slic::LogStream::m_name [private] |
LOG::ELevel slic::LogStream::m_outputLevel [private] |
Definition at line 417 of file LogStream.hh.
Referenced by getOutputLevel(), operator<<(), and setOutputLevel().
ostream* slic::LogStream::m_os [private] |
bool slic::LogStream::m_active [private] |
std::ofstream* slic::LogStream::m_fos [private] |
LogMessenger* slic::LogStream::m_messenger [private] |
1.5.4