From: didg Date: Thu, 29 Oct 2009 15:04:41 +0000 (+0000) Subject: the use of the new LOG code introduce a 50% code size penalty, text size with LOG... X-Git-Tag: before-ipv6~8 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=12400a59f246ccf0603efebdf11e17fd62329c50 the use of the new LOG code introduce a 50% code size penalty, text size with LOG: 514748 Bytes, without it : 365325 Bytes, no way that this stuff can stay. Add a new NO_DEBUG which remove log_debug when compile with O2, need a configure option --- diff --git a/include/atalk/logger.h b/include/atalk/logger.h index d7576325..27e870cf 100644 --- a/include/atalk/logger.h +++ b/include/atalk/logger.h @@ -73,13 +73,23 @@ enum loglevels { log_warning, log_note, log_info, +#ifndef NO_DEBUG log_debug, log_debug6, log_debug7, log_debug8, log_debug9, log_maxdebug +#else +#define log_debug -1 +#define log_debug6 -1 +#define log_debug7 -1 +#define log_debug8 -1 +#define log_debug9 -1 +#define log_maxdebug -1 +#endif }; + #define LOGLEVEL_STRING_IDENTIFIERS { \ "LOG_NOTHING", \ "LOG_SEVERE", \ @@ -235,9 +245,10 @@ void make_syslog_entry(enum loglevels loglevel, enum logtypes logtype, char *mes Note: any configured file-logging deactivates syslog logging */ - #define LOG(log_level, type, ...) \ do { \ + if (log_level < 0) \ + break; \ if ( ! log_config.inited) \ log_init(); \ if (file_configs[(type)].level >= (log_level)) \