Commit 9e5fd981 authored by Luciano Orsini's avatar Luciano Orsini
Browse files

references #115: logging local exceptions in sentinel::probe

parent 6161f9ac
......@@ -108,6 +108,7 @@ namespace sentinel
void processPendingEvents ();
xdata::String outputBus_;
xdata::Boolean loggingLocalExceptions_;
};
......
......@@ -86,6 +86,9 @@ sentinel::probe::Application::Application (xdaq::ApplicationStub * s)
outputBus_ = "";
this->getApplicationInfoSpace()->fireItemAvailable("outputBus", &outputBus_);
loggingLocalExceptions_ = false;
this->getApplicationInfoSpace()->fireItemAvailable("loggingLocalExceptions", &loggingLocalExceptions_);
xgi::framework::deferredbind(this, this, &sentinel::probe::Application::Default, "Default");
//xgi::framework::deferredbind(this, this, &sentinel::probe::Application::view, "view");
xgi::bind(this, &sentinel::probe::Application::view, "view");
......@@ -124,6 +127,14 @@ bool sentinel::probe::Application::handleException (xcept::Exception& ex, void*
LOG4CPLUS_DEBUG(this->getApplicationLogger(), "Probe received exception '" << ex.name() << "'");
if ( loggingLocalExceptions_ )
{
if ( ex.getProperty("urn:xdaq-application:context") == this->getApplicationDescriptor()->getContextDescriptor()->getURL())
{
LOG4CPLUS_ERROR(this->getApplicationLogger(), "Logging qualified exception: " << xcept::stdformat_exception_history(ex));
}
}
for (std::list<std::pair<xcept::Exception, size_t> >::iterator i = exceptions_.begin(); i != exceptions_.end(); ++i)
{
// Send a single message for each exception accumulated
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment