*/
/* GO_FASTER
- You can #define GO_FASTER to disable informational logging.
- This disables the ProxyHTMLLogVerbose option altogether.
-
- Default is to leave it undefined, and enable verbose logging
- as a configuration option. Binaries are supplied with verbose
- logging enabled.
+ You can #define GO_FASTER to disable trace logging.
*/
#ifdef GO_FASTER
int strip_comments;
int interp;
int enabled;
-#ifndef GO_FASTER
- int verbose;
-#endif
} proxy_html_conf;
typedef struct {
ap_filter_t* f;
size_t len, offs;
urlmap* themap = ctx->map;
#ifndef GO_FASTER
- int verbose = ctx->cfg->verbose;
+ int verbose = APLOGrtrace1(ctx->f->r);
#endif
pappend(ctx, &c, 1); /* append null byte */
VERBOSEB(
const char* f = apr_pstrndup(ctx->f->r->pool,
ctx->buf + offs, s_from);
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, ctx->f->r,
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0, ctx->f->r,
"C/RX: match at %s, substituting %s", f, subs);
)
if (s_to > s_from) {
len = strlen(ctx->buf);
if ((m->flags & M_ATEND) && (match < (len - s_from)))
continue;
- VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, ctx->f->r,
+ VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0, ctx->f->r,
"C: matched %s, substituting %s",
m->from.c, m->to));
if (s_to > s_from) {
size_t nmatch;
ap_regmatch_t pmatch[10];
#ifndef GO_FASTER
- int verbose = ctx->cfg->verbose;
+ int verbose = APLOGrtrace1(ctx->f->r);
#endif
apr_array_header_t *linkattrs;
int i;
const char* f;
f = apr_pstrndup(ctx->f->r->pool,
ctx->buf + offs, s_from);
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0,
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0,
ctx->f->r,
"H/RX: match at %s, substituting %s",
f, subs);
++num_match;
s_to = strlen(m->to);
len = strlen(ctx->buf);
- VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_INFO,
+ VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_TRACE3,
0, ctx->f->r,
"H: matched %s, substituting %s",
m->from.c, m->to));
const char* f;
f = apr_pstrndup(ctx->f->r->pool,
ctx->buf + offs, s_from);
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0,
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0,
ctx->f->r,
"E/RX: match at %s, substituting %s",
f, subs);
found = strstr(ctx->buf+match+s_to,
m->from.c);
}
- VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_INFO,
+ VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_TRACE3,
0, ctx->f->r,
"E: matched %s, substituting %s",
m->from.c, m->to));
}
}
-static meta* metafix(request_rec* r, const char* buf
-#ifndef GO_FASTER
- , int verbose
-#endif
- )
+static meta* metafix(request_rec* r, const char* buf)
{
meta* ret = NULL;
size_t offs = 0;
ret->end = pmatch[0].rm_eo;
}
if (header && content) {
- VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
- "Adding header [%s: %s] from HTML META",
- header, content));
+#ifndef GO_FASTER
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,
+ "Adding header [%s: %s] from HTML META",
+ header, content);
+#endif
apr_table_setn(r->headers_out, header, content);
}
offs += pmatch[0].rm_eo;
replacement = "";
}
str = apr_pstrcat(r->pool, before, replacement, after, NULL);
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
"Interpolating %s => %s", var, replacement);
}
return str;
if (errmsg) {
#ifndef GO_FASTER
- if (cfg->verbose) {
- ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, f->r, "%s", errmsg);
- }
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, f->r, "%s", errmsg);
#endif
ap_remove_output_filter(f);
return NULL;
"Unsupported parser opts %x", xmlopts);
#endif
if (ctxt->cfg->metafix)
-#ifndef GO_FASTER
- m = metafix(f->r, buf, ctxt->cfg->verbose);
-#else
m = metafix(f->r, buf);
-#endif
if (m) {
consume_buffer(ctxt, buf, m->start, 0);
consume_buffer(ctxt, buf+m->end, bytes-m->end, 0);
conf->interp = add->interp;
conf->strip_comments = add->strip_comments;
conf->enabled = add->enabled;
-#ifndef GO_FASTER
- conf->verbose = add->verbose;
-#endif
}
else {
conf->flags = base->flags | add->flags;
conf->interp = base->interp | add->interp;
conf->strip_comments = base->strip_comments | add->strip_comments;
conf->enabled = add->enabled | base->enabled;
-#ifndef GO_FASTER
- conf->verbose = base->verbose | add->verbose;
-#endif
}
return conf;
}
AP_INIT_FLAG("ProxyHTMLStripComments", ap_set_flag_slot,
(void*)APR_OFFSETOF(proxy_html_conf, strip_comments),
RSRC_CONF|ACCESS_CONF, "Strip out comments"),
-#ifndef GO_FASTER
- AP_INIT_FLAG("ProxyHTMLLogVerbose", ap_set_flag_slot,
- (void*)APR_OFFSETOF(proxy_html_conf, verbose),
- RSRC_CONF|ACCESS_CONF,
- "Verbose Logging (use with LogLevel Info)"),
-#endif
AP_INIT_TAKE1("ProxyHTMLBufSize", ap_set_int_slot,
(void*)APR_OFFSETOF(proxy_html_conf, bufsz),
RSRC_CONF|ACCESS_CONF, "Buffer size"),