summaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorBruce Montrose <montrose@itd.nrl.navy.mil>2002-07-12 18:14:17 +0000
committerBruce Montrose <montrose@itd.nrl.navy.mil>2002-07-12 18:14:17 +0000
commitbe25ffd5d76fe1ed4a3e6ea983fcbdcbbdf13453 (patch)
treeec4f7c496c7a29c41e04cab082504eebcec75971 /src/common/log.c
parentd00c39231df6acf5c831974f4f55b96f8fa348c4 (diff)
downloadtor-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.c31
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;
}