Throwing an exception in the logger, almost cetainly will cause
trouble. Coverity
1428667 shows this can happen in
LdapBackend::~LdapBackend().
return log;
}
-void Logger::log(const string &msg, Urgency u)
+void Logger::log(const string &msg, Urgency u) noexcept
{
#ifndef RECURSOR
bool mustAccount(false);
}
#ifndef RECURSOR
- if(mustAccount)
- S.ringAccount("logmessages",msg);
+ if(mustAccount) {
+ try {
+ S.ringAccount("logmessages",msg);
+ }
+ catch (const runtime_error& e) {
+ cerr << e.what() << endl;
+ }
+ }
#endif
}
\param msg Message you wish to log
\param u Urgency of the message you wish to log
*/
- void log(const string &msg, Urgency u=Notice);
+ void log(const string &msg, Urgency u=Notice) noexcept;
void setFacility(int f){d_facility=f;open();} //!< Choose logging facility
void setFlag(int f){flags|=f;open();} //!< set a syslog flag