From e2f4833fd119a4236f391a5f9f7da8196a61b102 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 16 Aug 2013 08:02:52 +0000 Subject: [PATCH] Add logtest function. --- ncat/util.c | 10 ++++++++++ ncat/util.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/ncat/util.c b/ncat/util.c index b8317d22b..e5af6748b 100644 --- a/ncat/util.c +++ b/ncat/util.c @@ -212,6 +212,16 @@ void logdebug(const char *fmt, ...) va_end(ap); } +void logtest(const char *fmt, ...) +{ + va_list ap; + + fprintf(stderr, "NCAT TEST: "); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); +} + /* Exit status 2 indicates a program error other than a network error. */ void die(char *err) { diff --git a/ncat/util.h b/ncat/util.h index 67e8e786c..70891213b 100644 --- a/ncat/util.h +++ b/ncat/util.h @@ -156,6 +156,8 @@ void loguser_noprefix(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); void logdebug(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +void logtest(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); /* handle errors */