MsgLogger/include/MsgLogStream.h File Reference

#include <string>
#include <sstream>
#include "MsgLogger/MsgLogLevel.h"
#include "MsgLogger/MsgLogger.h"

Go to the source code of this file.

Namespaces

namespace  MsgLogger

Classes

class  MsgLogger::MsgLogStream

Defines

#define MsgLog(logger, sev, msg)
 Macro which sends single message to a named logger in logging service.
#define MsgLogRoot(sev, msg)
 Macro which sends single message to a root logger in logging service.
#define WithMsgLog(logger, sev, str)   for ( MsgLogger::MsgLogStream str(logger, MsgLogger::MsgLogLevel(MsgLogger::MsgLogLevel::sev), __FILE__ , __LINE__) ; str.ok() ; str.finish() )
 Macro which provides scoped logging stream with output sent to a named logger.
#define WithMsgLogRoot(sev, str)   for ( MsgLogger::MsgLogStream str(MsgLogger::MsgLogLevel(MsgLogger::MsgLogLevel::sev), __FILE__ , __LINE__) ; str.ok() ; str.finish() )
 Macro which provides scoped logging stream with output sent to a root logger.


Define Documentation

#define MsgLog ( logger,
sev,
msg   ) 

Value:

if ( MsgLogger::MsgLogger(logger).logging(MsgLogger::MsgLogLevel(MsgLogger::MsgLogLevel::sev)) ) { \
    MsgLogger::MsgLogStream _msg_log_stream_123(logger, MsgLogger::MsgLogLevel(MsgLogger::MsgLogLevel::sev), __FILE__, __LINE__) ;\
    _msg_log_stream_123.ostream_hack() << msg ; \
  }
Macro which sends single message to a named logger in logging service.

Parameters:
logger Name of the logger
sev Severity level (one of debug, trace, info, warning, error)
msg Message, anything that can appear on the right side of << operator.
This macro provides convenience method for working with the messaging facility. If the logging level configured by application for the given logger name (first argument) allows messages of the given severity (second argument) then everything included in the last argument is formatted via << insertion operator and sent to logging service. Brief example:
  MsgLog("logger", debug, "key = " << key << " value = " << value << " count = " << count);

Definition at line 77 of file MsgLogStream.h.

Referenced by PSXtcInput::IndexXtcReader::add(), PSEvt::DamageMap::addSrcDamage(), psana::PrintEventId::beginCalibCycle(), psana::EventKeys::beginCalibCycle(), PSXtcInput::XtcInputModuleBase::beginJob(), psana::PrintEventId::beginJob(), psana::EventKeys::beginJob(), psana::PrintEventId::beginRun(), psana::EventKeys::beginRun(), checkForAndRecordSrcDamage(), psana::PSAna::dataSource(), psana::PrintEventId::endCalibCycle(), psana::EventKeys::endCalibCycle(), psana::PrintEventId::endJob(), psana::EventKeys::endJob(), psana::PrintEventId::endRun(), psana::EventKeys::endRun(), PSXtcInput::XtcInputModuleBase::event(), psana::EventKeys::event(), PSXtcInput::DamagePolicy::eventDamagePolicy(), psana::ExpNameFromConfig::ExpNameFromConfig(), IData::Dataset::files(), PSXtcInput::XtcInputModuleBase::fillEnv(), PSXtcInput::XtcInputModuleBase::fillEvent(), PSXtcInput::XtcInputModuleBase::fillEventDgList(), PSXtcInput::XtcInputModuleBase::fillEventId(), guessType(), PSXtcInput::Index::Index(), PSXtcInput::DgramSourceFile::init(), PSXtcInput::IndexXtcReader::jump(), psana::DynLoader::loadPackageLib(), psana::InputIter::next(), PSEvt::Event::GetResultProxy::operator boost::shared_ptr(), parse(), parseBldInfo(), parseDetInfo(), IData::Dataset::parseHdfFileName(), parseProcInfo(), IData::Dataset::parseXtcFileName(), psana::PrintEventId::printId(), PSXtcInput::myLevelIter::process(), PSShmemInput::ShmemMonitorClient::processDgram(), PSXtcInput::RunMap::RunMap(), IData::Dataset::setDefOption(), PSXtcInput::Index::setrun(), PSEnv::EpicsStoreImpl::store(), PSEnv::EpicsStoreImpl::storeAlias(), PSXtcInput::IndexRun::times(), PSXtcInput::XtcIndexInputModule::XtcIndexInputModule(), PSXtcInput::XtcInputModuleBase::XtcInputModuleBase(), PSXtcInput::DgramSourceFile::~DgramSourceFile(), and PSShmemInput::DgramSourceShmem::~DgramSourceShmem().

#define MsgLogRoot ( sev,
msg   ) 

Value:

if ( MsgLogger::MsgLogger().logging(MsgLogger::MsgLogLevel(MsgLogger::MsgLogLevel::sev)) ) { \
    MsgLogger::MsgLogStream _msg_log_stream_123(MsgLogger::MsgLogLevel(MsgLogger::MsgLogLevel::sev), __FILE__, __LINE__) ;\
    _msg_log_stream_123.ostream_hack() << msg ; \
  }
Macro which sends single message to a root logger in logging service.

Parameters:
sev Severity level (one of debug, trace, info, warning, error)
msg Message, anything that can appear on the right side of << operator.
See MsgLog for details. Brief example:
  MsgLogRoot(debug, "key = " << key << " value = " << value << " count = " << count);

Definition at line 99 of file MsgLogStream.h.

Referenced by psana::PSAna::dataSource(), psana::PrintSeparator::event(), PSEnv::Env::hmgr(), psana::PSAnaApp::runApp(), and psana::PSAnaApp::setConfigFileAndOptions().

#define WithMsgLog ( logger,
sev,
str   )     for ( MsgLogger::MsgLogStream str(logger, MsgLogger::MsgLogLevel(MsgLogger::MsgLogLevel::sev), __FILE__ , __LINE__) ; str.ok() ; str.finish() )

Macro which provides scoped logging stream with output sent to a named logger.

Parameters:
logger Name of the logger
sev severity level (one of debug, trace, info, warning, error)
str stream
The use of this macro must be followed by the compound statement (enclosed in {}). The stream defined by this macro (last argument) is available inside the compound statement and can be used multiple times. All output to this stream is collected and is sent to the messaging service at the end of the scope of the compound statement; complete output appears as a single message. This macro is useful when output is produced inside loop or if/then/else statement. Brief example:
  WithMsgLog("logger", debug, out) {
    if (condition) out << "condition is true, ";
    out << "values: ";
    for (int i = 0; i < max; ++ i) out << ' ' << value[i];
  }

Definition at line 130 of file MsgLogStream.h.

Referenced by psana::ExpNameFromDs::ExpNameFromDs(), PSXtcInput::DgramSourceFile::init(), and psana::InputIter::next().

#define WithMsgLogRoot ( sev,
str   )     for ( MsgLogger::MsgLogStream str(MsgLogger::MsgLogLevel(MsgLogger::MsgLogLevel::sev), __FILE__ , __LINE__) ; str.ok() ; str.finish() )

Macro which provides scoped logging stream with output sent to a root logger.

Parameters:
sev severity level (one of debug, trace, info, warning, error)
str stream
See WithMsgLog for details. Brief example:
  WithMsgLogRoot(debug, out) {
    if (condition) out << "condition is true, ";
    out << "values: ";
    for (int i = 0; i < max; ++ i) out << ' ' << value[i];
  }

Definition at line 153 of file MsgLogStream.h.


Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7