| 225 | } |
| 226 | |
| 227 | void md_result_log(md_result_t *result, unsigned int level) |
| 228 | { |
| 229 | if (md_log_is_level(result->p, (md_log_level_t)level)) { |
| 230 | const char *sep = ""; |
| 231 | const char *msg = ""; |
| 232 | |
| 233 | if (result->md_name) { |
| 234 | msg = apr_psprintf(result->p, "md[%s]", result->md_name); |
| 235 | sep = " "; |
| 236 | } |
| 237 | if (result->activity) { |
| 238 | msg = apr_psprintf(result->p, "%s%swhile[%s]", msg, sep, result->activity); |
| 239 | sep = " "; |
| 240 | } |
| 241 | if (result->problem) { |
| 242 | msg = apr_psprintf(result->p, "%s%sproblem[%s]", msg, sep, result->problem); |
| 243 | sep = " "; |
| 244 | } |
| 245 | if (result->detail) { |
| 246 | msg = apr_psprintf(result->p, "%s%sdetail[%s]", msg, sep, result->detail); |
| 247 | sep = " "; |
| 248 | } |
| 249 | if (result->subproblems) { |
| 250 | msg = apr_psprintf(result->p, "%s%ssubproblems[%s]", msg, sep, |
| 251 | md_json_writep(result->subproblems, result->p, MD_JSON_FMT_COMPACT)); |
| 252 | sep = " "; |
| 253 | } |
| 254 | md_log_perror(MD_LOG_MARK, (md_log_level_t)level, result->status, result->p, "%s", msg); |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | void md_result_on_change(md_result_t *result, md_result_change_cb *cb, void *data) |
| 259 | { |
no test coverage detected