1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-10-17 07:37:39 +00:00

log.c and log.h from CVSHEAD (adds LogDebug() Function)

This commit is contained in:
Florian Westphal
2006-02-08 21:23:21 +00:00
parent 51b22759b6
commit a854a38616
2 changed files with 37 additions and 8 deletions

View File

@@ -14,7 +14,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: log.c,v 1.57.2.1 2005/08/29 11:19:48 alex Exp $";
static char UNUSED id[] = "$Id: log.c,v 1.57.2.2 2006/02/08 21:23:21 fw Exp $";
#include "imp.h"
#include <assert.h>
@@ -44,15 +44,15 @@ static char UNUSED id[] = "$Id: log.c,v 1.57.2.1 2005/08/29 11:19:48 alex Exp $"
#include "log.h"
LOCAL char Init_Txt[127];
LOCAL bool Is_Daemon;
static char Init_Txt[127];
static bool Is_Daemon;
#ifdef DEBUG
LOCAL char Error_File[FNAME_LEN];
static char Error_File[FNAME_LEN];
#endif
LOCAL void Wall_ServerNotice PARAMS(( char *Msg ));
static void Wall_ServerNotice PARAMS(( char *Msg ));
GLOBAL void
@@ -162,6 +162,35 @@ Log_Exit( void )
} /* Log_Exit */
# ifdef PROTOTYPES
GLOBAL void
LogDebug( const char *Format, ... )
# else
GLOBAL void
LogDebug( Format, va_alist )
const char *Format;
va_dcl
# endif
#ifdef DEBUG
{
char msg[MAX_LOG_MSG_LEN];
va_list ap;
if (!NGIRCd_Debug) return;
#ifdef PROTOTYPES
va_start( ap, Format );
#else
va_start( ap );
#endif
vsnprintf( msg, MAX_LOG_MSG_LEN, Format, ap );
va_end( ap );
Log(LOG_DEBUG, "%s", msg);
}
#else
{ /* do nothing */ }
#endif /* DEBUG */
#ifdef PROTOTYPES
GLOBAL void
Log( int Level, const char *Format, ... )
@@ -174,7 +203,6 @@ va_dcl
#endif
{
/* Eintrag in Logfile(s) schreiben */
char msg[MAX_LOG_MSG_LEN];
bool snotice;
va_list ap;
@@ -306,7 +334,7 @@ va_dcl
* Send log messages to users flagged with the "s" mode.
* @param Msg The message to send.
*/
LOCAL void
static void
Wall_ServerNotice( char *Msg )
{
CLIENT *c;

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: log.h,v 1.18 2005/06/24 19:55:10 alex Exp $
* $Id: log.h,v 1.18.2.1 2006/02/08 21:23:21 fw Exp $
*
* Logging functions (header)
*/
@@ -39,6 +39,7 @@ GLOBAL void Log_Init PARAMS(( bool Daemon_Mode ));
GLOBAL void Log_Exit PARAMS(( void ));
GLOBAL void Log PARAMS(( int Level, const char *Format, ... ));
GLOBAL void LogDebug PARAMS(( const char *Format, ... ));
GLOBAL void Log_Init_Resolver PARAMS(( void ));
GLOBAL void Log_Exit_Resolver PARAMS(( void ));