don't print log messages below a certain priority

This commit is contained in:
ehouse 2005-10-30 05:10:26 +00:00
parent f6f5e6eaf0
commit ae4821d5f5
2 changed files with 20 additions and 19 deletions

View file

@ -59,12 +59,10 @@
#include "timermgr.h" #include "timermgr.h"
#include "permid.h" #include "permid.h"
#define N_WORKER_THREADS 5
#define MILLIS 1000
void void
logf( XW_LogLevel level, const char* format, ... ) logf( XW_LogLevel level, const char* format, ... )
{ {
if ( level <= XW_LOGINFO ) {
FILE* where = stderr; FILE* where = stderr;
struct tm* timp; struct tm* timp;
struct timeval tv; struct timeval tv;
@ -82,6 +80,7 @@ logf( XW_LogLevel level, const char* format, ... )
vfprintf( where, format, ap ); vfprintf( where, format, ap );
va_end(ap); va_end(ap);
fprintf( where, "\n" ); fprintf( where, "\n" );
}
} /* logf */ } /* logf */
static int static int

View file

@ -8,8 +8,10 @@
typedef unsigned char HostID; typedef unsigned char HostID;
typedef enum { typedef enum {
XW_LOGINFO XW_LOGERROR
,XW_LOGERROR ,XW_LOGINFO
,XW_LOGVERBOSE0
,XW_LOGVERBOSE1
} XW_LogLevel; } XW_LogLevel;
void logf( XW_LogLevel level, const char* format, ... ); void logf( XW_LogLevel level, const char* format, ... );