freebsd-src/contrib/ntp/include/ntp_debug.h
Cy Schubert 2b15cb3d09 MFV ntp 4.2.8p1 (r258945, r275970, r276091, r276092, r276093, r278284)
Thanks to roberto for providing pointers to wedge this into HEAD.

Approved by:	roberto
2015-03-30 13:30:15 +00:00

28 lines
635 B
C

/*
* $Header$
*
* $Created: Sat Aug 20 14:23:01 2005 $
*
* Copyright (C) 2005 by Frank Kardel
*/
#ifndef NTP_DEBUG_H
#define NTP_DEBUG_H
/*
* macro for debugging output - cut down on #ifdef pollution.
*
* TRACE() is similar to ntpd's DPRINTF() for utilities and libntp.
* Uses mprintf() and so supports %m, replaced by strerror(errno).
*
* The calling convention is not attractive:
* TRACE(debuglevel, (fmt, ...));
* TRACE(2, ("this will appear on stdout if debug >= %d\n", 2));
*/
#define TRACE(lvl, arg) \
do { \
if (debug >= (lvl)) \
mprintf arg; \
} while (0)
#endif /* NTP_DEBUG_H */