add debug checking version of logging function.

(Logical change 1.17)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@39 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2004-06-30 19:07:39 +00:00
parent 21f189dde9
commit b7579dec5d
2 changed files with 23 additions and 0 deletions

View File

@ -56,6 +56,27 @@ internal_log_printf (int level, char *string, ...)
va_end(ap);
}
void
internal_log_printf_checkdebug (int level, char *string, ...)
{
va_list ap;
char newstring[1024];
va_start(ap, string);
#ifdef DEBUG
sprintf (newstring, "L(%x): %s", level, string);
vfprintf(stderr, newstring, ap);
#else
if (level != LOG_LEVEL_DEBUG) {
sprintf (newstring, "L(%x): %s", level, string);
vfprintf(stderr, newstring, ap);
}
#endif
va_end(ap);
}
extern char *getSaClmNodeAddressT (SaClmNodeAddressT *nodeAddress) {
int i;
static char node_address[300];

View File

@ -45,6 +45,8 @@
extern void internal_log_printf (int level, char *string, ...);
extern void internal_log_printf_checkdebug (int level, char *string, ...);
/*
* The optimizer will remove DEBUG logging messages in production builds
*/