CVS update: samba/source/param

John Reilly jreilly at au2.samba.org
Wed Feb 7 05:43:53 EST 2001


Date:	Wednesday February 7, 2001 @ 5:43
Author:	jreilly

Update of /data/cvs/samba/source/param
In directory samba:/tmp/cvs-serv28177/param

Modified Files:
      Tag: APPLIANCE_HEAD
	loadparm.c 
Log Message:
Tired of wading through megabytes of debug logs? Here is an often discussed idea (thanks
Jeremy & Tim). Instead of using DEBUGLEVEL, an array of DEBUGLEVEL_CLASS values are used.
The macros test both the debug class value and the old DEBUGLEVEL, so it is back-compatible.
Default: if existing source file unchanged, DEBUGLEVEL operates as before. Entire files
(i.e. "classes" of debug functionality) may be switched to a debug class by adding two
lines after #include "includes.h":

  #undef  DBGC_CLASS
  #define DBGC_CLASS DBGC_<your class name here>

Individual DEBUG macros may also be changed to a debug class. For example, to get debug
output for the debug class DBGC_XXX, change:

  DEBUG( 3, ("blah blah %s\n", some_string))  to
  DEBUGC( DBGC_XXX, 3, ("blah blah %s\n", some_string))

To enable debug class settings, the following syntax for smb.conf sets the DEBUGLEVEL
to 1, the prindrivers debug class to 10, and the tdb debug class to 5:

  debug level = 1 printdrivers:10 tdb:5

smbcontrol also supports the above syntax with the added ability to turn on/off values
without affecting existing settings.

- include/proto.h: the usual update
- include/debug.h: added DEBUGLEVEL_CLASS array, changed DEBUGLEVEL to a macro
    added macros for a number of DBGC_CLASS's
    changed existing DEBUG* macros to use the class values
    added DEBUG*C macros that allow specific class selection
- lib/debug.c: changed DEBUGLEVEL to point to DEBUGLEVEL_CLASS[0]
    added parse routines for class specifications
- lib/messages.c: changed debuglevel_message() to send DEBUGLEVEL_CLASS array
- param/loadparm.c: changed DEBUGLEVEL ref to DEBUGLEVEL_CLASS
    changed "log level" and "debuglevel" to use DEBUGLEVEL_CLASS
- utils/smbcontrol.c: changed debuglevel_function(), do_command() to use DEBUGLEVEL_CLASS

Now we need to figure which files to set to what. I know Tim can't wait (-:

JohnR





More information about the samba-cvs mailing list