httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1082975 - /httpd/httpd/trunk/docs/manual/developer/new_api_2_4.xml
Date Fri, 18 Mar 2011 17:12:32 GMT
Author: trawick
Date: Fri Mar 18 17:12:32 2011
New Revision: 1082975

URL: http://svn.apache.org/viewvc?rev=1082975&view=rev
Log:
separate the issue of passing APLOG_MARK to your own functions
and the sometimes-related issue of not passing APLOG_MARK to ap_log_*(),
adding coverage for APLOG_MODULE_INDEX

Modified:
    httpd/httpd/trunk/docs/manual/developer/new_api_2_4.xml

Modified: httpd/httpd/trunk/docs/manual/developer/new_api_2_4.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/developer/new_api_2_4.xml?rev=1082975&r1=1082974&r2=1082975&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/developer/new_api_2_4.xml (original)
+++ httpd/httpd/trunk/docs/manual/developer/new_api_2_4.xml Fri Mar 18 17:12:32 2011
@@ -277,14 +277,32 @@
     </example>
     <p>The number of parameters of the <code>ap_log_*</code> functions
and the
        definition of <code>APLOG_MARK</code> has changed. Normally, the change
-       is completely transparent. However, if a module implements wrapper
-       functions for <code>ap_log_*</code> and uses <code>APLOG_MARK</code>
-       when calling these wrappers, some adjustments are necessary.
-       The easiest way is for the module to define and use a different macro
-       that expands to the parameters required by the log wrapper functions.
-       <code>APLOG_MARK</code> should only be used when calling
-       <code>ap_log_*</code> without additional wrappers. In this way, the
-       code will remain compatible with HTTPD 2.0 and 2.2.</p>
+       is completely transparent. However, changes are required if a
+       module uses <code>APLOG_MARK</code> as a parameter to its own functions
+       or if a module calls <code>ap_log_*</code> without passing
+       <code>APLOG_MARK</code>.  A module which uses wrappers
+       around <code>ap_log_*</code> typically uses both of these constructs.</p>
+
+    <p>The easiest way to change code which passes <code>APLOG_MARK</code>
to
+       its own functions is to define and use a different macro that expands to
+       the parameters required by those functions, as <code>APLOG_MARK</code>
+       should only be used when calling <code>ap_log_*</code>
+       directly.  In this way, the code will remain compatible with HTTPD 2.0
+       and 2.2.</p>
+
+    <p>Code which calls <code>ap_log_*</code> without passing 
+       <code>APLOG_MARK</code> will necessarily differ between 2.4 and earlier
+       releases, as 2.4 requires a new third argument,
+       <code>APLOG_MODULE_INDEX</code>.</p>
+
+    <example>
+       /* code for httpd 2.0/2.2 */<br />
+       ap_log_perror(file, line, APLOG_ERR, 0, p, "Failed to allocate dynamic lock structure");<br
/>
+       <br />
+       /* code for httpd 2.4 */<br />
+       ap_log_perror(file, line, APLOG_MODULE_INDEX, APLOG_ERR, 0, p, "Failed to allocate
dynamic lock structure");<br />
+       <br />
+    </example>
 
     <p>A <code>server_rec</code> pointer must be passed to 
        <code>ap_log_error()</code> when called after startup.  This



Mime
View raw message