From f1abfacd4d230075e5c4029271f2f3952ac2c68a Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Mon, 3 Aug 1998 18:13:13 +0000 Subject: I finished removing timestring() calls from DEBUG() messages. Also went through and changed some DEBUG() calls to DEBUGADD() to combine output under a single timestamp. There were too many timestamps. Note that Jeremy has told me that he's working on adding a config parameter to turn timestamps off. Cool. Chris -)----- (This used to be commit 247dbc9a24987035a47f1ba4fa143b1e2c050e92) --- source3/nmbd/nmbd_become_lmb.c | 30 ++++++++++++++++++++++++------ source3/nmbd/nmbd_browsesync.c | 9 +++++++-- source3/nmbd/nmbd_logonnames.c | 10 +++++++--- source3/nmbd/nmbd_packets.c | 12 +++++++----- source3/nmbd/nmbd_workgroupdb.c | 4 ++-- 5 files changed, 47 insertions(+), 18 deletions(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd_become_lmb.c b/source3/nmbd/nmbd_become_lmb.c index f66723eb17..2d007ecd75 100644 --- a/source3/nmbd/nmbd_become_lmb.c +++ b/source3/nmbd/nmbd_become_lmb.c @@ -153,8 +153,14 @@ void unbecome_local_master_success(struct subnet_record *subrec, /* Now reset the workgroup and server state. */ reset_workgroup_state( subrec, released_name->name, force_new_election ); - DEBUG(0,("\n%s ***** Samba name server %s has stopped being a local master browser for workgroup %s \ -on subnet %s *****\n\n", timestring(), global_myname, released_name->name, subrec->subnet_name)); + if( DEBUGLVL( 0 ) ) + { + dbgtext( "*****\n\n" ); + dbgtext( "Samba name server %s ", global_myname ); + dbgtext( "has stopped being a local master browser " ); + dbgtext( "for workgroup %s ", released_name->name ); + dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name ); + } } @@ -182,8 +188,14 @@ Removing from namelist anyway.\n", namestr(fail_name))); /* Now reset the workgroup and server state. */ reset_workgroup_state( subrec, fail_name->name, force_new_election ); - DEBUG(0,("\n%s ***** Samba name server %s has stopped being a local master browser for workgroup %s \ -on subnet %s *****\n\n", timestring(), global_myname, fail_name->name, subrec->subnet_name)); + if( DEBUGLVL( 0 ) ) + { + dbgtext( "*****\n\n" ); + dbgtext( "Samba name server %s ", global_myname ); + dbgtext( "has stopped being a local master browser " ); + dbgtext( "for workgroup %s ", fail_name->name ); + dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name ); + } } /******************************************************************* @@ -392,8 +404,14 @@ on subnet %s\n", work->work_group, subrec->subnet_name)); master browser as soon as possible that we are a local master browser. */ reset_announce_timer(); - DEBUG(0,("\n%s ***** Samba name server %s is now a local master browser for workgroup %s \ -on subnet %s *****\n\n", timestring(), global_myname, work->work_group, subrec->subnet_name)); + if( DEBUGLVL( 0 ) ) + { + dbgtext( "*****\n\n" ); + dbgtext( "Samba name server %s ", global_myname ); + dbgtext( "is now a local master browser " ); + dbgtext( "for workgroup %s ", work->work_group ); + dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name ); + } } diff --git a/source3/nmbd/nmbd_browsesync.c b/source3/nmbd/nmbd_browsesync.c index fd55fe161d..dcf2ea3c48 100644 --- a/source3/nmbd/nmbd_browsesync.c +++ b/source3/nmbd/nmbd_browsesync.c @@ -101,8 +101,13 @@ static void sync_browse_lists(struct subnet_record *subrec, struct work_record * static struct cli_state cli; uint32 local_type = local ? SV_TYPE_LOCAL_LIST_ONLY : 0; - DEBUG(2,("%s: sync_browse_lists: Sync browse lists with server %s<%02x> at IP %s for workgroup %s\n", - timestring(), name, nm_type, inet_ntoa(ip), work->work_group )); + if( DEBUGLVL( 2 ) ) + { + dbgtext( "sync_browse_lists():\n" ); + dbgtext( "Sync browse lists with server %s<%02x> ", name, nm_type ); + dbgtext( "at IP %s ", inet_ntoa( ip ) ); + dbgtext( "for workgroup %s\n", work->work_group ); + } /* Check we're not trying to sync with ourselves. This can happen if we are a domain *and* a local master browser. */ diff --git a/source3/nmbd/nmbd_logonnames.c b/source3/nmbd/nmbd_logonnames.c index dbbb8defaf..4486fb2840 100644 --- a/source3/nmbd/nmbd_logonnames.c +++ b/source3/nmbd/nmbd_logonnames.c @@ -156,9 +156,13 @@ void add_logon_names(void) if (find_name_on_subnet(subrec, &nmbname, FIND_SELF_NAME) == NULL) { - DEBUG(0,("add_domain_logon_names: At time %s attempting to become \ -logon server for workgroup %s on subnet %s\n", timestring(), global_myworkgroup, - subrec->subnet_name)); + if( DEBUGLVL( 0 ) ) + { + dbgtext( "add_domain_logon_names:\n" ); + dbgtext( "Attempting to become logon server " ); + dbgtext( "for workgroup %s ", global_myworkgroup ); + dbgtext( "on subnet %s\n", subrec->subnet_name ); + } become_logon_server(subrec, work); } } diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c index 23db845348..1f216e3111 100644 --- a/source3/nmbd/nmbd_packets.c +++ b/source3/nmbd/nmbd_packets.c @@ -95,9 +95,11 @@ Dumps out the browse packet data. static void debug_browse_data(char *outbuf, int len) { int i,j; + + DEBUG( 4, ( "debug_browse_data():\n" ) ); for (i = 0; i < len; i+= 16) { - DEBUG(4, ("%3x char ", i)); + DEBUGADD( 4, ( "%3x char ", i ) ); for (j = 0; j < 16; j++) { @@ -107,19 +109,19 @@ static void debug_browse_data(char *outbuf, int len) if (i+j >= len) break; - DEBUG(4, ("%c", x)); + DEBUGADD( 4, ( "%c", x ) ); } - DEBUG(4, (" hex ", i)); + DEBUGADD( 4, ( " hex ", i ) ); for (j = 0; j < 16; j++) { if (i+j >= len) break; - DEBUG(4, (" %02x", (unsigned char)outbuf[i+j])); + DEBUGADD( 4, ( " %02x", (unsigned char)outbuf[i+j] ) ); } - DEBUG(4, ("\n")); + DEBUGADD( 4, ("\n") ); } } diff --git a/source3/nmbd/nmbd_workgroupdb.c b/source3/nmbd/nmbd_workgroupdb.c index 818875c820..51b2519d83 100644 --- a/source3/nmbd/nmbd_workgroupdb.c +++ b/source3/nmbd/nmbd_workgroupdb.c @@ -183,11 +183,11 @@ struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec, { if (!strcmp(ret->work_group,name)) { - DEBUG(4, ("found\n")); + DEBUGADD(4, ("found.\n")); return(ret); } } - DEBUG(4, ("not found\n")); + DEBUGADD(4, ("not found.\n")); return NULL; } -- cgit