| 54 | }; |
| 55 | |
| 56 | static void do_debug_log(request_rec *r, const char *hookname) |
| 57 | { |
| 58 | log_debug_dirconf *dconf = ap_get_module_config(r->per_dir_config, &log_debug_module); |
| 59 | int i; |
| 60 | if (dconf->entries == NULL) |
| 61 | return; |
| 62 | |
| 63 | for (i = 0; i < dconf->entries->nelts; i++) { |
| 64 | const char *msg, *err; |
| 65 | msg_entry *entry = APR_ARRAY_IDX(dconf->entries, i, msg_entry *); |
| 66 | if (entry->hook != allhooks && entry->hook != hookname) |
| 67 | continue; |
| 68 | if (entry->condition) { |
| 69 | int ret = ap_expr_exec(r, entry->condition, &err); |
| 70 | if (err) { |
| 71 | ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00640) |
| 72 | "Can't evaluate condition: %s", err); |
| 73 | continue; |
| 74 | } |
| 75 | if (!ret) |
| 76 | continue; |
| 77 | } |
| 78 | msg = ap_expr_str_exec(r, entry->msg_expr, &err); |
| 79 | if (err) |
| 80 | ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00641) |
| 81 | "Can't evaluate message expression: %s", err); |
| 82 | if (APLOGrdebug(r)) |
| 83 | /* Intentional no APLOGNO */ |
| 84 | ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, |
| 85 | "%s (%s hook, %s:%d)", |
| 86 | msg, hookname, entry->msg_expr->filename, |
| 87 | entry->msg_expr->line_number); |
| 88 | else |
| 89 | /* Intentional no APLOGNO */ |
| 90 | ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, |
| 91 | "%s", msg); |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | static int log_debug_log_transaction(request_rec *r) |
| 96 | { |
no test coverage detected