From 94fc44a93c46cece9b9fa947bff62087dbcd89fa Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 12 Feb 2001 16:18:02 +0000 Subject: Merge of JohnR's changes to appliance-head, JF's changes to 2.2, updated the POSIX_ACL code to be in sync. Jeremy. (This used to be commit c0517d6f4e3079feca1309fd1ea7b21e83f0de02) --- source3/lib/debug.c | 128 +++++++++++++++++++++++++++++++++++++++++++++--- source3/lib/messages.c | 3 +- source3/lib/msrpc_use.c | 4 +- 3 files changed, 125 insertions(+), 10 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/debug.c b/source3/lib/debug.c index 9d520b6c2f..e7772bbd38 100644 --- a/source3/lib/debug.c +++ b/source3/lib/debug.c @@ -82,7 +82,8 @@ FILE *dbf = NULL; pstring debugf = ""; BOOL append_log = False; -int DEBUGLEVEL = 1; +int DEBUGLEVEL_CLASS[DBGC_LAST]; +int DEBUGLEVEL = DEBUGLEVEL_CLASS; /* -------------------------------------------------------------------------- ** @@ -114,22 +115,137 @@ static int syslog_level = 0; static pstring format_bufr = { '\0' }; static size_t format_pos = 0; +/* +* Define all the debug class selection names here. Names *MUST NOT* contain +* white space. There must be one name for each DBGC_, and they +* must be in the table in the order of DBGC_.. +*/ +char *classname_table[] = { + "all", /* DBGC_ALL; index references traditional DEBUGLEVEL */ + "tdb", /* DBGC_TDB */ + "printdrivers", /* DBGC_PRINTDRIVERS */ + "lanman", /* DBGC_LANMAN */ +}; + /* -------------------------------------------------------------------------- ** * Functions... */ +/**************************************************************************** +utility access to debug class names's +****************************************************************************/ +char* debug_classname_from_index(int idx) +{ + return classname_table[idx]; +} + +/**************************************************************************** +utility to translate names to debug class index's +****************************************************************************/ +int debug_lookup_classname(char* classname) +{ + int i; + + if (!classname) return -1; + + for (i=0; i