mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2026-02-01 19:59:04 +00:00
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:
parent
21f189dde9
commit
b7579dec5d
21
exec/print.c
21
exec/print.c
@ -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];
|
||||
|
||||
@ -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
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user