Ignore:
Timestamp:
Mar 1, 2010, 3:05:48 PM (15 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3.x to 3.3.11

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/docs/htmldocs/Samba3-Developers-Guide/debug.html

    r368 r411  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 4. The samba DEBUG system</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt02.html" title="Part II. Samba Basics"><link rel="prev" href="architecture.html" title="Chapter 3. Samba Architecture"><link rel="next" href="internals.html" title="Chapter 5. Samba Internals"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. The samba DEBUG system</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="architecture.html">Prev</a> </td><th width="60%" align="center">Part II. Samba Basics</th><td width="20%" align="right"> <a accesskey="n" href="internals.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 4. The samba DEBUG system"><div class="titlepage"><div><div><h2 class="title"><a name="debug"></a>Chapter 4. The samba DEBUG system</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Chris</span> <span class="surname">Hertel</span></h3></div></div><div><p class="pubdate">July 1998</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="debug.html#id2563001">New Output Syntax</a></span></dt><dt><span class="sect1"><a href="debug.html#id2563111">The DEBUG() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2563216">The DEBUGADD() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2563252">The DEBUGLVL() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2563343">New Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#id2563348">dbgtext()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2563364">dbghdr()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2563383">format_debug_text()</a></span></dt></dl></dd></dl></div><div class="sect1" title="New Output Syntax"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2563001"></a>New Output Syntax</h2></div></div></div><p>
     1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 4. The samba DEBUG system</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt02.html" title="Part II. Samba Basics"><link rel="prev" href="architecture.html" title="Chapter 3. Samba Architecture"><link rel="next" href="internals.html" title="Chapter 5. Samba Internals"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. The samba DEBUG system</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="architecture.html">Prev</a> </td><th width="60%" align="center">Part II. Samba Basics</th><td width="20%" align="right"> <a accesskey="n" href="internals.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="debug"></a>Chapter 4. The samba DEBUG system</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Chris</span> <span class="surname">Hertel</span></h3></div></div><div><p class="pubdate">July 1998</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="debug.html#id2556929">New Output Syntax</a></span></dt><dt><span class="sect1"><a href="debug.html#id2557038">The DEBUG() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2557144">The DEBUGADD() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2557180">The DEBUGLVL() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2557271">New Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#id2557276">dbgtext()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2557292">dbghdr()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2557311">format_debug_text()</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2556929"></a>New Output Syntax</h2></div></div></div><p>
    22   The syntax of a debugging log file is represented as:
    33</p><pre class="programlisting">
     
    2626LINE is the line number of the debug statement that generated the
    2727message.
    28 </p><p>Basically, what that all means is:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
     28</p><p>Basically, what that all means is:</p><div class="orderedlist"><ol type="1"><li><p>
    2929A debugging log file is made up of debug messages.
    30 </p></li><li class="listitem"><p>
     30</p></li><li><p>
    3131Each debug message is made up of a header and text. The header is
    3232separated from the text by a newline.
    33 </p></li><li class="listitem"><p>
     33</p></li><li><p>
    3434The header begins with the timestamp and debug level of the
    3535message enclosed in brackets. The filename, function, and line
     
    3939compiler, the function name may be missing (it is generated by the
    4040__FUNCTION__ macro, which is not universally implemented, dangit).
    41 </p></li><li class="listitem"><p>
     41</p></li><li><p>
    4242The message text is made up of zero or more lines, each terminated
    4343by a newline.
     
    5252the header line. That's because the example above was generated on an
    5353SGI Indy, and the SGI compiler doesn't support the __FUNCTION__ macro.
    54 </p></div><div class="sect1" title="The DEBUG() Macro"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2563111"></a>The DEBUG() Macro</h2></div></div></div><p>
     54</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2557038"></a>The DEBUG() Macro</h2></div></div></div><p>
    5555Use of the DEBUG() macro is unchanged. DEBUG() takes two parameters.
    5656The first is the message level, the second is the body of a function
     
    103103      .
    104104</pre><p>Which isn't much use. The format buffer kludge fixes this problem.
    105 </p></div><div class="sect1" title="The DEBUGADD() Macro"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2563216"></a>The DEBUGADD() Macro</h2></div></div></div><p>
     105</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2557144"></a>The DEBUGADD() Macro</h2></div></div></div><p>
    106106In addition to the kludgey solution to the broken line problem
    107107described above, there is a clean solution. The DEBUGADD() macro never
     
    117117      This is the second line.
    118118      This is the third line.
    119 </pre></div><div class="sect1" title="The DEBUGLVL() Macro"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2563252"></a>The DEBUGLVL() Macro</h2></div></div></div><p>
     119</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2557180"></a>The DEBUGLVL() Macro</h2></div></div></div><p>
    120120One of the problems with the DEBUG() macro was that DEBUG() lines
    121121tended to get a bit long. Consider this example from
     
    144144    dbgtext( "for workgroup %s\n", work-&gt;work_group );
    145145    }
    146 </pre><p>(The dbgtext() function is explained below.)</p><p>There are a few advantages to this scheme:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
     146</pre><p>(The dbgtext() function is explained below.)</p><p>There are a few advantages to this scheme:</p><div class="orderedlist"><ol type="1"><li><p>
    147147The test is performed only once.
    148 </p></li><li class="listitem"><p>
     148</p></li><li><p>
    149149You can allocate variables off of the stack that will only be used
    150150within the DEBUGLVL() block.
    151 </p></li><li class="listitem"><p>
     151</p></li><li><p>
    152152Processing that is only relevant to debug output can be contained
    153153within the DEBUGLVL() block.
    154 </p></li></ol></div></div><div class="sect1" title="New Functions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2563343"></a>New Functions</h2></div></div></div><div class="sect2" title="dbgtext()"><div class="titlepage"><div><div><h3 class="title"><a name="id2563348"></a>dbgtext()</h3></div></div></div><p>
     154</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2557271"></a>New Functions</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557276"></a>dbgtext()</h3></div></div></div><p>
    155155This function prints debug message text to the debug file (and
    156156possibly to syslog) via the format buffer. The function uses a
     
    161161If you use DEBUGLVL() you will probably print the body of the
    162162message using dbgtext().
    163 </p></div><div class="sect2" title="dbghdr()"><div class="titlepage"><div><div><h3 class="title"><a name="id2563364"></a>dbghdr()</h3></div></div></div><p>
     163</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557292"></a>dbghdr()</h3></div></div></div><p>
    164164This is the function that writes a debug message header.
    165165Headers are not processed via the format buffer. Also note that
     
    169169It is not likely that this function will be called directly. It
    170170is used by DEBUG() and DEBUGADD().
    171 </p></div><div class="sect2" title="format_debug_text()"><div class="titlepage"><div><div><h3 class="title"><a name="id2563383"></a>format_debug_text()</h3></div></div></div><p>
     171</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557311"></a>format_debug_text()</h3></div></div></div><p>
    172172This is a static function in debug.c. It stores the output text
    173173for the body of the message in a buffer until it encounters a
Note: See TracChangeset for help on using the changeset viewer.