diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-12-02 09:01:21 +0000 |
---|---|---|
committer | <> | 2014-12-04 16:11:25 +0000 |
commit | bdab5265fcbf3f472545073a23f8999749a9f2b9 (patch) | |
tree | c6018dd03dea906f8f1fb5f105f05b71a7dc250a /include/ntp_debug.h | |
download | ntp-bdab5265fcbf3f472545073a23f8999749a9f2b9.tar.gz |
Imported from /home/lorry/working-area/delta_ntp/ntp-dev-4.2.7p482.tar.gz.ntp-dev-4.2.7p482
Diffstat (limited to 'include/ntp_debug.h')
-rw-r--r-- | include/ntp_debug.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/ntp_debug.h b/include/ntp_debug.h new file mode 100644 index 0000000..b0e846e --- /dev/null +++ b/include/ntp_debug.h @@ -0,0 +1,27 @@ +/* + * $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 */ |