You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sc...@apache.org on 2006/11/27 08:29:27 UTC
svn commit: r479531 - /httpd/httpd/trunk/modules/experimental/mod_example.c
Author: sctemme
Date: Sun Nov 26 23:29:26 2006
New Revision: 479531
URL: http://svn.apache.org/viewvc?view=rev&rev=479531
Log:
* Move the error log slug higher in the trace function, so it gets
executed even if the trace_add returns in the middle
* Add a direct-to-stderr path in case we don't have a server_rec to log
for
* Remove now redundant direct-to-sterr from x_monitor callback
Modified:
httpd/httpd/trunk/modules/experimental/mod_example.c
Modified: httpd/httpd/trunk/modules/experimental/mod_example.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/experimental/mod_example.c?view=diff&rev=479531&r1=479530&r2=479531
==============================================================================
--- httpd/httpd/trunk/modules/experimental/mod_example.c (original)
+++ httpd/httpd/trunk/modules/experimental/mod_example.c Sun Nov 26 23:29:26 2006
@@ -387,6 +387,28 @@
x_subpool = p;
trace_copy = trace;
}
+
+ /*
+ * You *could* change the following if you wanted to see the calling
+ * sequence reported in the server's error_log, but beware - almost all of
+ * these co-routines are called for every single request, and the impact
+ * on the size (and readability) of the error_log is considerable.
+ */
+#ifndef EXAMPLE_LOG_EACH
+#define EXAMPLE_LOG_EACH 0
+#endif
+ if (EXAMPLE_LOG_EACH) {
+ if (s != NULL) {
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "mod_example: %s",
+ note);
+ } else {
+ apr_file_t *out = NULL;
+ apr_file_open_stderr(&out, p);
+ apr_file_printf(out, "mod_example traced in non-loggable "
+ "context: %s\n", note);
+ }
+ }
+
/*
* If we weren't passed a configuration record, we can't figure out to
* what location this call applies. This only happens for co-routines
@@ -435,18 +457,6 @@
else {
trace = trace_copy;
}
- /*
- * You *could* change the following if you wanted to see the calling
- * sequence reported in the server's error_log, but beware - almost all of
- * these co-routines are called for every single request, and the impact
- * on the size (and readability) of the error_log is considerable.
- */
-#ifndef EXAMPLE_LOG_EACH
-#define EXAMPLE_LOG_EACH 0
-#endif
- if (EXAMPLE_LOG_EACH && (s != NULL)) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "mod_example: %s", note);
- }
}
/*--------------------------------------------------------------------------*/
@@ -1390,12 +1400,6 @@
*/
static int x_monitor(apr_pool_t *p)
{
- apr_file_t *out = NULL;
-
- apr_file_open_stderr(&out, p);
-
- apr_file_printf(out, "Example module monitor hook handler\n");
-
trace_add(NULL, NULL, NULL, "x_monitor()");
return DECLINED;
}