Example #1
0
Message::Message(const Exception& e, DistributionRealm realm, 
		 PayloadSignificance sig, bool highlight) throw():
  m_hostname(s_this_hostname), m_origin(MO_LOCAL), m_zone(-1),
  m_program(s_this_program), m_title(e.title()), m_realm(realm), 
  m_significance(sig), m_message_oss(e.message()), m_details_oss(e.details()), 
  m_function(e.function(highlight)), m_time()
{
  m_time.tv_sec=e.time().tv_sec;
  m_time.tv_usec=e.time().tv_usec;
}
QDebug operator<<(QDebug debug, const Exception &exception)
{
    debug.nospace() << "Exception: " << exception.type() << "\n"
                       "Function:  " << exception.function() << "\n"
                       "File:      " << exception.file() << "\n"
                       "Line:      " << exception.line() << "\n";
    if (!exception.description().isEmpty())
        debug.nospace() << exception.description();

    if (!exception.backTrace().isEmpty())
        debug.nospace() << exception.backTrace();

    return debug.space();
}