From bbf4463fdaece258637204cf47597374c253f3ef Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Thu, 31 Jul 2014 13:54:00 +0100 Subject: [PATCH] create a static global logger as a default logger. For now this logs everything on stderr. --- include/tr/logger.h | 2 ++ src/stderr.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/tr/logger.h b/include/tr/logger.h index a21cf56..3ebd06d 100644 --- a/include/tr/logger.h +++ b/include/tr/logger.h @@ -54,6 +54,8 @@ TR_CLASS(TR_LoggerSyslog) { TR_EXTENDS(TR_Logger); }; +extern TR_Logger TR_logger; + #endif // __TR_LOGGER_H__ // vim: set ts=4 sw=4: diff --git a/src/stderr.c b/src/stderr.c index a0e7a05..aa3f4e6 100644 --- a/src/stderr.c +++ b/src/stderr.c @@ -36,4 +36,7 @@ logStderr(void * this, TR_logger_level level, const char * const msg) TR_INIT_IFACE(TR_Logger, logStderr); TR_CREATE_CLASS(TR_LoggerStderr, TR_Logger, TR_IF(TR_Logger)); +TR_INSTANCE(TR_LoggerStderr, TR_debugConlogger, {TR_LOGGER_DEBUG}); +TR_Logger TR_logger = TR_INSTANCE_CAST(TR_Logger, TR_debugConlogger); + // vim: set ts=4 sw=4: