File: debug_msg.c

package info (click to toggle)
ganglia-monitor-core 2.5.7-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,300 kB
  • ctags: 3,900
  • sloc: ansic: 27,889; sh: 8,492; makefile: 148
file content (27 lines) | stat: -rw-r--r-- 615 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * @file debug_msg.c Debug Message function
 */
/* $Id: debug_msg.c,v 1.4 2003/05/06 17:49:23 sacerdoti Exp $ */
#include "gangliaconf.h"

int debug_level = 0;

/**
 * @fn void debug_msg(const char *format, ...)
 * Prints the message to STDERR if DEBUG is #defined
 * @param format The format of the msg (see printf manpage)
 * @param ... Optional arguments
 */
void
debug_msg(const char *format, ...)
{
   if (debug_level > 1 && format)
      {
         va_list ap;
         va_start(ap, format);
         vfprintf(stderr, format, ap);
         fprintf(stderr,"\n");
         va_end(ap);
      } 
   return;
}