summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-10-06 17:39:28 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-10-06 17:39:28 +0200
commit08cbabbfb79d8e618c2fd0c9e0398d8ffee4a6c3 (patch)
tree292b32a4197a037cdc6245943c32c93eea171975 /common
parent822e4770454e7dc11d5ecb8dde7f074b3c07b0df (diff)
downloadeurephia-08cbabbfb79d8e618c2fd0c9e0398d8ffee4a6c3.tar.gz
eurephia-08cbabbfb79d8e618c2fd0c9e0398d8ffee4a6c3.tar.xz
eurephia-08cbabbfb79d8e618c2fd0c9e0398d8ffee4a6c3.zip
Don't log source filename and line number if DEBUG is not enabled
Diffstat (limited to 'common')
-rw-r--r--common/eurephia_log.c18
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);