- Timestamp:
- May 23, 2008, 6:56:41 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/docs/htmldocs/Samba3-Developers-Guide/debug.html
r44 r134 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.71.0"><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#id322739">New Output Syntax</a></span></dt><dt><span class="sect1"><a href="debug.html#id322834">The DEBUG() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id322926">The DEBUGADD() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id322958">The DEBUGLVL() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id323036">New Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#id323042">dbgtext()</a></span></dt><dt><span class="sect2"><a href="debug.html#id323055">dbghdr()</a></span></dt><dt><span class="sect2"><a href="debug.html#id323071">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="id322739"></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.2"><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#id346556">New Output Syntax</a></span></dt><dt><span class="sect1"><a href="debug.html#id346649">The DEBUG() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id346738">The DEBUGADD() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id346768">The DEBUGLVL() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id346843">New Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#id346849">dbgtext()</a></span></dt><dt><span class="sect2"><a href="debug.html#id346862">dbghdr()</a></span></dt><dt><span class="sect2"><a href="debug.html#id346878">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="id346556"></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="id3 22834"></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="id346649"></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="id3 22926"></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="id346738"></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="id3 22958"></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="id346768"></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="id3 23036"></a>New Functions</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id323042"></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="id346843"></a>New Functions</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id346849"></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="id3 23055"></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="id346862"></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="id3 23071"></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="id346878"></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.