repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 1c7b9dbe931ecbb0f355ab66c9b422f7e6001058:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 1c7b9dbe931ecbb0f355ab66c9b422f7e6001058
Author: Florian Westphal 
Date:   Sat Jan 10 00:44:34 2009 +0100

    remove unneeded LOG_DEBUG when not compiling with DEBUG support

    when ngircd is build without DEBUG enabled, LOG_DEBUG messages
    are always discarded.

    To avoid the extra code, ngircd has a LogDebug() wrapper which
    gets removed by the compiler when compiling without DEBUG defined.

    Update a few functings which were using the
    Log(LOG_DEBUG, .. interface directly without #ifdef DEBUG guards.

       text    data     bss     dec     hex filename
     127748    1900   28280  157928   268e8 ngircd.before
     126836    1896   28280  157012   26554 ngircd.after

diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c
index 8caa81a02971baaa4add589857e3b69b0a0d3eb3..
index ..46e42acd834ea9bcc7600e33406367ac74cd3ef3 100644
--- a/src/ngircd/channel.c
+++ b/src/ngircd/channel.c
@@ -876,7 +876,7 @@ Add_Client( CHANNEL *Chan, CLIENT *Client )
 	cl2chan->next = My_Cl2Chan;
 	My_Cl2Chan = cl2chan;

-	Log( LOG_DEBUG, "User \"%s\" joined channel \"%s\".", Client_Mask( Client ), Chan->name );
+	LogDebug("User \"%s\" joined channel \"%s\".", Client_Mask(Client), Chan->name);

 	return cl2chan;
 } /* Add_Client */
diff --git a/src/ngircd/client.c b/src/ngircd/client.c
index 1d01f784387bac124925d41c01844ebc7ae1a991..
index ..fbe130a13a9c0267926e8568263eafabaf592330 100644
--- a/src/ngircd/client.c
+++ b/src/ngircd/client.c
@@ -1047,7 +1047,7 @@ Generate_MyToken( CLIENT *Client )
 		else c = (CLIENT *)c->next;
 	}
 	Client->mytoken = token;
-	Log( LOG_DEBUG, "Assigned token %d to server \"%s\".", token, Client->id );
+	LogDebug("Assigned token %d to server \"%s\".", token, Client->id);
 } /* Generate_MyToken */


diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c
index 943612edf03f06ef7204890e27fa0fdbe1544670..
index ..1091852bbb0865da87c06a6275c91bc0961d95c7 100644
--- a/src/ngircd/irc-login.c
+++ b/src/ngircd/irc-login.c
@@ -242,7 +242,7 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
 		    Client_Type(target) != CLIENT_SERVICE &&
 		    Client_Type(target) != CLIENT_SERVER) {
 			/* New client */
-			Log( LOG_DEBUG, "Connection %d: got valid NICK command ...", 
+			LogDebug("Connection %d: got valid NICK command ...",
 			     Client_Conn( Client ));

 			/* Register new nickname of this client */
@@ -723,7 +723,7 @@ IRC_PONG(CLIENT *Client, REQUEST *Req)

 	/* The connection timestamp has already been updated when the data has
 	 * been read from so socket, so we don't need to update it here. */
-
+#ifdef DEBUG
 	if (Client_Conn(Client) > NONE)
 		Log(LOG_DEBUG,
 			"Connection %d: received PONG. Lag: %ld seconds.",
@@ -732,7 +732,7 @@ IRC_PONG(CLIENT *Client, REQUEST *Req)
 	else
 		 Log(LOG_DEBUG,
 			"Connection %d: received PONG.", Client_Conn(Client));
-
+#endif
 	return CONNECTED;
 } /* IRC_PONG */

diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c
index ed70a9bb9d3618519e6ad5f2837cba0a600f7742..
index ..aa979ac32dd287d436deaf7ff61687542ccc4360 100644
--- a/src/ngircd/irc-mode.c
+++ b/src/ngircd/irc-mode.c
@@ -531,7 +531,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
 				strlcat(the_args, " ", sizeof(the_args));
 				strlcat(the_args, Client_ID(client), sizeof(the_args));
 				strlcat(the_modes, x, sizeof(the_modes));
-				Log(LOG_DEBUG, "User \"%s\": Mode change on %s, now \"%s\"",
+				LogDebug("User \"%s\": Mode change on %s, now \"%s\"",
 					Client_Mask(client), Channel_Name(Channel), Channel_UserModes(Channel, client));
 			}
 		} else {
@@ -539,7 +539,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
 			retval = set ? Channel_ModeAdd(Channel, x[0]) : Channel_ModeDel(Channel, x[0]);
 			if (retval) {
 				strlcat(the_modes, x, sizeof(the_modes));
-				Log(LOG_DEBUG, "Channel %s: Mode change, now \"%s\".", Channel_Name(Channel), Channel_Modes(Channel));
+				LogDebug("Channel %s: Mode change, now \"%s\".", Channel_Name(Channel), Channel_Modes(Channel));
 			}
 		}

diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
index b56429531c6dede4636c72b8ec2c1c91cfdc200b..
index ..ad1168ad49a7969811e9bb6b95d51d1bbace53c9 100644
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -316,7 +316,7 @@ main( int argc, const char *argv[] )
 #ifdef ZLIB
 		strlcat( NGIRCd_ProtoID, "Z", sizeof NGIRCd_ProtoID );
 #endif
-		Log( LOG_DEBUG, "Protocol and server ID is \"%s\".", NGIRCd_ProtoID );
+		LogDebug("Protocol and server ID is \"%s\".", NGIRCd_ProtoID);

 		/* Vordefinierte Channels anlegen */
 		Channel_InitPredefined( );
diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c
index ec856a0c28fc05ff33b5d1930c79ee4bdb3f75b1..
index ..6801997141b64740a0776a4b8e0888df54fbdc67 100644
--- a/src/ngircd/parse.c
+++ b/src/ngircd/parse.c
@@ -180,7 +180,7 @@ Parse_Request( CONN_ID Idx, char *Request )
 		ptr = strchr( Request, ' ' );
 		if( ! ptr )
 		{
-			Log( LOG_DEBUG, "Connection %d: Parse error: prefix without command!?", Idx );
+			LogDebug("Connection %d: Parse error: prefix without command!?", Idx);
 			return Conn_WriteStr( Idx, "ERROR :Prefix without command!?" );
 		}
 		*ptr = '\0';
diff --git a/src/ngircd/resolve.c b/src/ngircd/resolve.c
index 999ef9906df241f3c3d195524df8fb86c1082907..
index ..e7f73ad5c3c32cf801ce891c15fa1a45689fcad5 100644
--- a/src/ngircd/resolve.c
+++ b/src/ngircd/resolve.c
@@ -14,8 +14,6 @@

 #include "portab.h"

-static char UNUSED id[] = "$Id: resolve.c,v 1.29 2008/02/26 22:04:17 fw Exp $";
-
 #include "imp.h"
 #include 
 #include 
@@ -92,7 +90,7 @@ Resolve_Addr(RES_STAT * s, const ng_ipaddr_t *Addr, int identsock,

 	pid = Resolver_fork(pipefd);
 	if (pid > 0) {
-		Log(LOG_DEBUG, "Resolver for %s created (PID %d).", ng_ipaddr_tostr(Addr), pid);
+		LogDebug("Resolver for %s created (PID %d).", ng_ipaddr_tostr(Addr), pid);

 		s->pid = pid;
 		s->resolver_fd = pipefd[0];

-----END OF PAGE-----