src/log.c

/* [<][>]
[^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following functions.
  1. logPrint

/* $Id: log.c,v 1.7 2002/03/24 13:05:12 proff Exp $ */

#include "nglobal.h"
#include "log.h"

/*
 * if anyone can work out how to do this in one syslog call, without
 * using vsprintf, I'd dearly like to know. CPP IS LAME.
 */

EXPORT char logPrintP[MAX_SYSLOG];

EXPORT char *logPrint (char *fmt,...) EXP_(GNUC_EXT(__attribute__ ((format (printf, 1, 2)))))
/* [<][>][^][v][top][bottom][index][help] */
{
        int i;
        va_list argp;
        va_start (argp, fmt);
        i = vsnprintf (logPrintP, MAX_SYSLOG-1, fmt, argp);
        va_end (argp);
        if (Debug_fd >= 0)
        {
                write(Debug_fd, logPrintP, strlen(logPrintP));
                write(Debug_fd, "\n", 1);
        }
        return logPrintP;
}

/* [<][>][^][v][top][bottom][index][help] */