diff options
Diffstat (limited to 'common/eurephia_log.c')
-rw-r--r-- | common/eurephia_log.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/common/eurephia_log.c b/common/eurephia_log.c index 7c4ace6..157b2d5 100644 --- a/common/eurephia_log.c +++ b/common/eurephia_log.c @@ -202,8 +202,9 @@ static void file_log(FILE *log, int logdst, int loglvl, const char *file, const pthread_mutex_unlock(&log_mutex); // Unblock other threads } + /** - * Internal function. This function should normally be called via the eurephia_log() function. + * Internal function. This function should normally be called via the veurephia_log() function. * * @param ctx eurephiaCTX * @param logdst Log destination, can be LOG_INFO, LOG_DEBUG, LOG_WARNING, LOG_ERROR, @@ -212,18 +213,15 @@ static void file_log(FILE *log, int logdst, int loglvl, const char *file, const * than what this parameter is set to, the message will not be logged. * @param file String containing file name of the place this function was called. Usually the __FILE__ macro. * @param line Line number of the source file this function was called. Usually the __LINE__ macro. - * @param fmt Contents of the log message (stdarg) + * @param ap stdarg's va_list data + * @param fmt stdarg's char *fmt pointer */ -void _eurephia_log_func(eurephiaCTX *ctx, int logdst, int loglvl, const char *file, const int line, - const char *fmt, ... ) +void _veurephia_log_func(eurephiaCTX *ctx, int logdst, int loglvl, const char *file, const int line, + va_list ap, const char *fmt) { - // Only log if we have an open log file and which has high enough log level if( (ctx != NULL) && (ctx->log != NULL) && (ctx->log->opened == 1) && (ctx->log->loglevel >= loglvl) ) { - va_list ap; - - va_start(ap, fmt); switch( ctx->log->logtype ) { case logFILE: file_log(ctx->log->logfile, logdst, loglvl, file, line, fmt, ap); @@ -232,7 +230,6 @@ void _eurephia_log_func(eurephiaCTX *ctx, int logdst, int loglvl, const char *fi vsyslog(syslog_priority[logdst], fmt, ap); break; } - va_end(ap); } } |