- Timestamp:
- May 20, 2009, 6:46:53 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/docs/htmldocs/Samba3-Developers-Guide/debug.html
r149 r204 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.73.1"><link rel="start" 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#id254934 3">New Output Syntax</a></span></dt><dt><span class="sect1"><a href="debug.html#id2549455">The DEBUG() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2549564">The DEBUGADD() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2549601">The DEBUGLVL() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2549694">New Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#id2549700">dbgtext()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2549716">dbghdr()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2549736">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="id2549343"></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.73.1"><link rel="start" 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#id2549347">New Output Syntax</a></span></dt><dt><span class="sect1"><a href="debug.html#id2549460">The DEBUG() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2549568">The DEBUGADD() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2549605">The DEBUGLVL() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2549698">New Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#id2549704">dbgtext()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2549720">dbghdr()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2549740">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="id2549347"></a>New Output Syntax</h2></div></div></div><p> 2 2 The syntax of a debugging log file is represented as: 3 3 </p><pre class="programlisting"> … … 52 52 the header line. That's because the example above was generated on an 53 53 SGI Indy, and the SGI compiler doesn't support the __FUNCTION__ macro. 54 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id25494 55"></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="id2549460"></a>The DEBUG() Macro</h2></div></div></div><p> 55 55 Use of the DEBUG() macro is unchanged. DEBUG() takes two parameters. 56 56 The first is the message level, the second is the body of a function … … 103 103 . 104 104 </pre><p>Which isn't much use. The format buffer kludge fixes this problem. 105 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id254956 4"></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="id2549568"></a>The DEBUGADD() Macro</h2></div></div></div><p> 106 106 In addition to the kludgey solution to the broken line problem 107 107 described above, there is a clean solution. The DEBUGADD() macro never … … 117 117 This is the second line. 118 118 This is the third line. 119 </pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id254960 1"></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="id2549605"></a>The DEBUGLVL() Macro</h2></div></div></div><p> 120 120 One of the problems with the DEBUG() macro was that DEBUG() lines 121 121 tended to get a bit long. Consider this example from … … 152 152 Processing that is only relevant to debug output can be contained 153 153 within the DEBUGLVL() block. 154 </p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id254969 4"></a>New Functions</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2549700"></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="id2549698"></a>New Functions</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2549704"></a>dbgtext()</h3></div></div></div><p> 155 155 This function prints debug message text to the debug file (and 156 156 possibly to syslog) via the format buffer. The function uses a … … 161 161 If you use DEBUGLVL() you will probably print the body of the 162 162 message using dbgtext(). 163 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id25497 16"></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="id2549720"></a>dbghdr()</h3></div></div></div><p> 164 164 This is the function that writes a debug message header. 165 165 Headers are not processed via the format buffer. Also note that … … 169 169 It is not likely that this function will be called directly. It 170 170 is used by DEBUG() and DEBUGADD(). 171 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id25497 36"></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="id2549740"></a>format_debug_text()</h3></div></div></div><p> 172 172 This is a static function in debug.c. It stores the output text 173 173 for the body of the message in a buffer until it encounters a
Note:
See TracChangeset
for help on using the changeset viewer.