MCPcopy Create free account
hub / github.com/ElementsProject/lightning / status_vfmt

Function status_vfmt

common/status.c:146–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void status_vfmt(enum log_level level,
147 const struct node_id *peer,
148 const char *fmt, va_list ap)
149{
150 char *str;
151
152 /* We only suppress async debug msgs. IO messages are even spammier
153 * but they only occur when explicitly asked for */
154 if (level == LOG_DBG && status_conn) {
155 size_t qlen = daemon_conn_queue_length(status_conn);
156
157 /* Once suppressing, we keep suppressing until we're empty */
158 if (traces_suppressed && qlen == 0) {
159 size_t n = traces_suppressed;
160 traces_suppressed = 0;
161 /* Careful: recursion! */
162 status_debug("...[%zu debug messages suppressed]...", n);
163 } else if (traces_suppressed || qlen > TRACE_QUEUE_LIMIT) {
164 traces_suppressed++;
165 return;
166 }
167 }
168 str = tal_vfmt(NULL, fmt, ap);
169 status_send(take(towire_status_log(NULL, level, peer, str)));
170 tal_free(str);
171}
172
173void status_fmt(enum log_level level,
174 const struct node_id *peer,

Callers 5

send_warningFunction · 0.85
hsmd_status_fmtFunction · 0.85
status_fmtFunction · 0.85
memleak_status_brokenFunction · 0.85
status_backtrace_printFunction · 0.85

Calls 4

status_sendFunction · 0.85
towire_status_logFunction · 0.85
tal_freeFunction · 0.85
daemon_conn_queue_lengthFunction · 0.70

Tested by

no test coverage detected