| 135 | } |
| 136 | |
| 137 | static void |
| 138 | paymod_log_header(struct payment *p, const char **type, u64 *id) |
| 139 | { |
| 140 | struct payment *root = payment_root(p); |
| 141 | /* We prefer to show the command ID here since it is also known |
| 142 | * by `lightningd`, so in theory it can be used to correlate |
| 143 | * debugging logs between the main `lightningd` and whatever |
| 144 | * plugin is using the paymod system. |
| 145 | * We only fall back to a unique id per root payment if there |
| 146 | * is no command with an id associated with this payment. |
| 147 | */ |
| 148 | if (root->cmd && root->cmd->id) { |
| 149 | *type = "cmd"; |
| 150 | *id = *root->cmd->id; |
| 151 | } else { |
| 152 | *type = "id"; |
| 153 | *id = root->id; |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | static void |
| 158 | paymod_log(struct payment *p, enum log_level l, const char *fmt, ...) |
no test coverage detected