| 347 | |
| 348 | PRINTF_FMT(4, 5) |
| 349 | static const char *cmd_log(const tal_t *ctx, |
| 350 | struct command *cmd, |
| 351 | enum log_level level, |
| 352 | const char *fmt, |
| 353 | ...) |
| 354 | { |
| 355 | va_list args; |
| 356 | const char *msg; |
| 357 | |
| 358 | va_start(args, fmt); |
| 359 | msg = tal_vfmt(ctx, fmt, args); |
| 360 | va_end(args); |
| 361 | |
| 362 | plugin_notify_message(cmd, level, "%s", msg); |
| 363 | |
| 364 | /* Notifications already get logged at debug. Otherwise reduce |
| 365 | * severity. */ |
| 366 | if (level != LOG_DBG) |
| 367 | plugin_log(cmd->plugin, |
| 368 | level == LOG_BROKEN ? level : level - 1, |
| 369 | "%s: %s", cmd->id, msg); |
| 370 | return msg; |
| 371 | } |
| 372 | |
| 373 | enum algorithm { |
| 374 | /* Min. Cost Flow by successive shortests paths. */ |
no test coverage detected