blob: c8f9883bc8d4148c46cc5d7a2b7f19f556c264d5 (
plain)
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
28
29
|
/* $NetBSD: ntp_debug.h,v 1.6 2020/05/25 20:47:19 christos Exp $ */
/*
* Header
*
* Created
*
* 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 */
|