diff options
author | Bruce Montrose <montrose@itd.nrl.navy.mil> | 2002-07-12 18:14:17 +0000 |
---|---|---|
committer | Bruce Montrose <montrose@itd.nrl.navy.mil> | 2002-07-12 18:14:17 +0000 |
commit | be25ffd5d76fe1ed4a3e6ea983fcbdcbbdf13453 (patch) | |
tree | ec4f7c496c7a29c41e04cab082504eebcec75971 /src/common/log.c | |
parent | d00c39231df6acf5c831974f4f55b96f8fa348c4 (diff) | |
download | tor-be25ffd5d76fe1ed4a3e6ea983fcbdcbbdf13453.tar.gz tor-be25ffd5d76fe1ed4a3e6ea983fcbdcbbdf13453.zip |
removed loglevel from global namespace. severity level is set using log() with a NULL format argument now. example: log(LOG_ERR,NULL);
svn:r44
Diffstat (limited to 'src/common/log.c')
-rw-r--r-- | src/common/log.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/common/log.c b/src/common/log.c index e85f2c9464..27212aeabc 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -8,8 +8,11 @@ /* * Changes : * $Log$ - * Revision 1.1 2002/06/26 22:45:50 arma - * Initial revision + * Revision 1.2 2002/07/12 18:14:16 montrose + * removed loglevel from global namespace. severity level is set using log() with a NULL format argument now. example: log(LOG_ERR,NULL); + * + * Revision 1.1.1.1 2002/06/26 22:45:50 arma + * initial commit: current code * * Revision 1.11 2002/06/14 20:44:57 mp292 * *** empty log message *** @@ -54,21 +57,25 @@ #include <errno.h> #include "log.h" -void log_internal(int severity, const char *format, va_list ap); - /* Outputs a message to stdout */ void log(int severity, const char *format, ...) { - extern int loglevel; + static int loglevel = LOG_DEBUG; va_list ap; - va_start(ap,format); - - if (severity <= loglevel) + if ( format ) { - vprintf(format,ap); - printf("\n"); - } + + va_start(ap,format); - va_end(ap); + if (severity <= loglevel) + { + vprintf(format,ap); + printf("\n"); + } + + va_end(ap); + } + else + loglevel = severity; } |