diff options
Diffstat (limited to 'common/eurephia_log.c')
-rw-r--r-- | common/eurephia_log.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/common/eurephia_log.c b/common/eurephia_log.c index dde99d8..aa80c07 100644 --- a/common/eurephia_log.c +++ b/common/eurephia_log.c @@ -75,13 +75,13 @@ static inline const char *logprio_str(int prio) { */ static const int syslog_priority[] = { -1, - LOG_INFO, /**< LOG_INFO */ - LOG_DEBUG, /**< LOG_DEBUG */ - LOG_WARNING, /**< LOG_WARNING */ - LOG_ERR, /**< LOG_ERROR */ - LOG_CRIT, /**< LOG_CRITICAL */ - LOG_ALERT, /**< LOG_FATAL */ - LOG_EMERG /**< LOG_PANIC */ + LOG_INFO, /**< LOG_INFO */ + LOG_DEBUG, /**< LOG_DEBUG */ + LOG_WARNING, /**< LOG_WARNING */ + LOG_ERR, /**< LOG_ERROR */ + LOG_CRIT, /**< LOG_CRITICAL */ + LOG_ALERT, /**< LOG_FATAL */ + LOG_EMERG /**< LOG_PANIC */ }; @@ -191,7 +191,11 @@ static void file_log(FILE *log, int logdst, int loglvl, const char *file, const // Do the logging pthread_mutex_lock(&log_mutex); // Block other threads from writing when we write +#ifdef ENABLE_DEBUG fprintf(log, "[%s] %s [%i] {%s:%i} ", tstmp_str, logprio_str(logdst), loglvl, file, line); +#else + fprintf(log, "[%s] %s [%i] ", tstmp_str, logprio_str(logdst), loglvl); +#endif vfprintf(log, fmt, ap); fprintf(log, "\n"); fflush(log); |