| 298 | |
| 299 | PRINTF_FMT(4, 5) |
| 300 | static const char *cmd_log(const tal_t *ctx, |
| 301 | struct command *cmd, |
| 302 | enum log_level level, |
| 303 | const char *fmt, |
| 304 | ...) |
| 305 | { |
| 306 | va_list args; |
| 307 | const char *msg; |
| 308 | |
| 309 | va_start(args, fmt); |
| 310 | msg = tal_vfmt(ctx, fmt, args); |
| 311 | va_end(args); |
| 312 | |
| 313 | plugin_notify_message(cmd, level, "%s", msg); |
| 314 | |
| 315 | /* Notifications already get logged at debug. Otherwise reduce |
| 316 | * severity. */ |
| 317 | if (level != LOG_DBG) |
| 318 | plugin_log(cmd->plugin, |
| 319 | level == LOG_BROKEN ? level : level - 1, |
| 320 | "%s: %s", cmd->id, msg); |
| 321 | return msg; |
| 322 | } |
| 323 | |
| 324 | enum algorithm { |
| 325 | /* Min. Cost Flow by successive shortests paths. */ |
no test coverage detected