diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2008-09-29 13:49:56 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-09-29 13:49:56 +0200 |
commit | ec9b998524c979a06b0373d5e76e9a9b1da89396 (patch) | |
tree | 7e7f23380e89c6fb51a9cea78c26370375c59855 | |
parent | 342068d6822a42aa93836896386b1ac9a332f853 (diff) | |
download | eurephia-ec9b998524c979a06b0373d5e76e9a9b1da89396.tar.gz eurephia-ec9b998524c979a06b0373d5e76e9a9b1da89396.tar.xz eurephia-ec9b998524c979a06b0373d5e76e9a9b1da89396.zip |
Simplified log code
Simplified and cleaned up commit e10a78562e28e35d6d7b360f691d8499447d45cb
-rw-r--r-- | eurephia_log.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/eurephia_log.c b/eurephia_log.c index 2050cff..a598278 100644 --- a/eurephia_log.c +++ b/eurephia_log.c @@ -39,11 +39,9 @@ const char *erp_logtypes[] = { // Simple log function ... Write log data to the context log file void eurephia_log(eurephiaCTX *ctx, int logdst, int loglvl, const char *fmt, ... ) { - if( ctx->log == NULL ) { - return; - } - // Only log info which is according to the log level set in the context - if( ctx->loglevel >= loglvl ) { + + // Only log if we have an open log file and which has high enough log level + if( (ctx->log != NULL) && (ctx->loglevel >= loglvl) ) { va_list ap; char tstmp_str[200]; time_t tstmp; |