From fb709522283bfb7558bf2b824a4143a919d59e97 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Wed, 24 Oct 2007 22:06:36 +0000 Subject: logf changes: * Disable logf by default and allow per-file enabling with "#define LOGF_ENABLE". To enable globally add that define in the config.h file. * Transform logf calls into DEBUGF calls when ROCKBOX_HAS_LOGF isn't defined, so that they get printed to the console in the sim. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15291 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/logf.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'firmware/export/logf.h') diff --git a/firmware/export/logf.h b/firmware/export/logf.h index 868e8fc723..b706f3a4b0 100644 --- a/firmware/export/logf.h +++ b/firmware/export/logf.h @@ -21,6 +21,7 @@ #include #include #include "../include/_ansi.h" +#include "debug.h" #ifdef ROCKBOX_HAS_LOGF @@ -38,8 +39,16 @@ extern bool logfwrap; void _logf(const char *format, ...) ATTRIBUTE_PRINTF(1, 2); #else /* !ROCKBOX_HAS_LOGF */ -/* built without logf() support enabled */ -#define logf(...) + +/* built without logf() support enabled, replace logf() by DEBUGF() */ +#define logf(f,args...) DEBUGF(f"\n",##args) + #endif /* !ROCKBOX_HAS_LOGF */ #endif /* LOGF_H */ + +/* Allow fine tuning (per file) of the logf output */ +#ifndef LOGF_ENABLE +#undef logf +#define logf(...) +#endif -- cgit v1.2.3