log: dump logging levels in crash dump

So you know what you are/are not seeing.

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-07-16 15:40:03 -07:00
parent d3c76f754f
commit de524abdb1
2 changed files with 23 additions and 0 deletions

View File

@ -258,6 +258,27 @@ void Log::dump_recent()
EntryQueue old;
_log_message("--- begin dump of recent events ---", true);
_flush(&m_recent, &old, true);
char buf[4096];
_log_message("--- logging levels ---", true);
for (vector<Subsystem>::iterator p = m_subs->m_subsys.begin();
p != m_subs->m_subsys.end();
++p) {
snprintf(buf, sizeof(buf), " %2d/%2d %s", p->log_level, p->gather_level, p->name.c_str());
_log_message(buf, true);
}
sprintf(buf, " %2d/%2d (syslog threshold)", m_syslog_log, m_syslog_crash);
_log_message(buf, true);
sprintf(buf, " %2d/%2d (stderr threshold)", m_stderr_log, m_stderr_crash);
_log_message(buf, true);
sprintf(buf, " max_recent %9d", m_max_recent);
_log_message(buf, true);
sprintf(buf, " max_new %9d", m_max_new);
_log_message(buf, true);
sprintf(buf, " log_file %s", m_log_file.c_str());
_log_message(buf, true);
_log_message("--- end dump of recent events ---", true);
pthread_mutex_unlock(&m_flush_mutex);

View File

@ -23,6 +23,8 @@ class SubsystemMap {
std::vector<Subsystem> m_subsys;
unsigned m_max_name_len;
friend class Log;
public:
SubsystemMap() : m_max_name_len(0) {}