summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eurephia_log.c8
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;