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

Function delete_threshold

lightningd/log.c:195–214  ·  view source on GitHub ↗

Threshold (of 1000) to delete */

Source from the content-addressed store, hash-verified

193
194/* Threshold (of 1000) to delete */
195static u32 delete_threshold(enum log_level level)
196{
197 switch (level) {
198 /* Delete 90% of log_io */
199 case LOG_IO_OUT:
200 case LOG_IO_IN:
201 return 900;
202 /* 50% of LOG_DBG */
203 case LOG_DBG:
204 return 500;
205 /* 25% of LOG_INFORM */
206 case LOG_INFORM:
207 return 250;
208 /* 5% of LOG_UNUSUAL / LOG_BROKEN */
209 case LOG_UNUSUAL:
210 case LOG_BROKEN:
211 return 50;
212 }
213 abort();
214}
215
216/* Delete a log entry: returns how many now deleted */
217static size_t delete_entry(struct log_book *log, struct log_entry *i)

Callers 1

prune_logFunction · 0.85

Calls 1

abortFunction · 0.85

Tested by

no test coverage detected