mirror of
https://github.com/ceph/ceph
synced 2025-01-20 18:21:57 +00:00
log: prefix dump with line numbers
This makes it easier to interpret the dump, and makes it obvious what is dump (and potentially a dup of something that was already logged) and what is not. Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
a68b3069de
commit
f7699cc993
@ -185,8 +185,12 @@ void Log::_flush(EntryQueue *t, EntryQueue *requeue, bool crash)
|
||||
bool do_stderr = (crash ? m_stderr_crash : m_stderr_log) >= e->m_prio;
|
||||
|
||||
if (do_fd || do_syslog || do_stderr) {
|
||||
int buflen = e->m_stamp.sprintf(buf, sizeof(buf));
|
||||
buflen += sprintf(buf + buflen, " %lx %2d ",
|
||||
int buflen = 0;
|
||||
|
||||
if (crash)
|
||||
buflen += snprintf(buf, sizeof(buf), "%6d> ", -t->m_len);
|
||||
buflen += e->m_stamp.sprintf(buf + buflen, sizeof(buf)-buflen);
|
||||
buflen += snprintf(buf + buflen, sizeof(buf)-buflen, " %lx %2d ",
|
||||
(unsigned long)e->m_thread, e->m_prio);
|
||||
|
||||
// FIXME: this is slow
|
||||
|
Loading…
Reference in New Issue
Block a user