From 9f11a060179d4b1f5765cae30ce970d603be712f Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Wed, 25 Jul 2012 10:08:47 +0200 Subject: [PATCH 22/28] Use APLOG_MODULE_INDEX in ap_log_error --- xs/Apache2/Log/Apache2__Log.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/xs/Apache2/Log/Apache2__Log.h b/xs/Apache2/Log/Apache2__Log.h index 4a3bb4d..8281e8e 100644 --- a/xs/Apache2/Log/Apache2__Log.h +++ b/xs/Apache2/Log/Apache2__Log.h @@ -78,12 +78,21 @@ static void mpxs_ap_log_error(pTHX_ int level, SV *sv, SV *msg) str = SvPV(msg,n_a); } +#if AP_SERVER_MAJORVERSION_NUMBER >= 2 && AP_SERVER_MINORVERSION_NUMBER >= 4 + if (r) { + ap_log_rerror(file, line, APLOG_MODULE_INDEX, level, 0, r, "%s", str); + } + else { + ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, "%s", str); + } +#else if (r) { ap_log_rerror(file, line, level, 0, r, "%s", str); } else { ap_log_error(file, line, level, 0, s, "%s", str); } +#endif if (svstr) { SvREFCNT_dec(svstr); @@ -264,12 +273,21 @@ MP_STATIC XS(MPXS_Apache2__Log_log_xerror) msgstr = SvPV(msgsv, n_a); +#if AP_SERVER_MAJORVERSION_NUMBER >= 2 && AP_SERVER_MINORVERSION_NUMBER >= 4 + if (r) { + ap_log_rerror(file, line, APLOG_MODULE_INDEX, level, status, r, "%s", msgstr); + } + else { + ap_log_error(file, line, APLOG_MODULE_INDEX, level, status, s, "%s", msgstr); + } +#else if (r) { ap_log_rerror(file, line, level, status, r, "%s", msgstr); } else { ap_log_error(file, line, level, status, s, "%s", msgstr); } +#endif SvREFCNT_dec(msgsv); -- 1.7.11.4