src/log.h

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

FUNCTIONS

This source file includes following functions.
  1. logt
  2. logl
  3. logn
  4. loglc
  5. logd
  6. loge
  7. logen
  8. logw
  9. logwn
  10. log
  11. loginne
  12. loginnw
  13. loginn

/* $Id: log.h,v 1.2 1999/12/24 09:44:35 proff Exp $
 * $Copyright$
 */

#ifndef LOG_H
#define 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.
 *
 * You need to call these macros like so:
 *
 *      logd(("messge id %s", msgid));
 */

#define logt(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        syslog(LOG_DEBUG, "%s:%d: %s", __FILE__, __LINE__, logPrint x);\
} while(0)

#define logl(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logListMerge)\
        {\
                syslog(LOG_DEBUG, "%s:%d: %s", __FILE__, __LINE__, logPrint x);\
        }\
} while(0)

#define logn(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logNocem)\
        {\
                syslog(LOG_DEBUG, "%s:%d: %s", __FILE__, __LINE__, logPrint x);\
        }\
} while(0)

#define loglc(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logListMergeCorrelation)\
        {\
                syslog(LOG_DEBUG, "%s:%d: %s", __FILE__, __LINE__, logPrint x);\
        }\
} while(0)

#define logd(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logDebug)\
        {\
                syslog(LOG_DEBUG, "%s:%d: %s", __FILE__, __LINE__, logPrint x);\
        }\
} while(0)

#define loge(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logErrors)\
        {\
                syslog(LOG_ERR, (errno ? "%s:%d:%m: %s" : "%s:%d: %s"), __FILE__, __LINE__, logPrint x);\
        }\
} while(0)

#define logen(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logErrors)\
        {\
                syslog(LOG_ERR, "%s:%d: %s", __FILE__, __LINE__, logPrint x);\
        }\
} while(0)

#define logw(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logWarnings)\
        {\
                syslog(LOG_WARNING, (errno ? "%s:%d:%m: %s" : "%s:%d: %s"), __FILE__, __LINE__, logPrint x);\
        }\
} while(0)

#define logwn(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logWarnings)\
        {\
                syslog(LOG_WARNING, "%s:%d: %s", __FILE__, __LINE__, logPrint x);\
        }\
} while(0)

#define log(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logInfo)\
        {\
                syslog(LOG_INFO, "%s", logPrint x);\
        }\
} while(0)

#define loginne(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logErrors && con->logInn)\
        {\
                syslog(LOG_ERR, "%s", logPrint x);\
        }\
} while(0)

#define loginnw(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logWarnings && con->logInn)\
        {\
                syslog(LOG_WARNING, "%s", logPrint x);\
        }\
} while(0)

#define loginn(x) \
/* [<][>][^][v][top][bottom][index][help] */
do\
{\
        if (con->logInfo && con->logInn)\
        {\
                syslog(LOG_INFO, "%s", logPrint x);\
        }\
} while(0)


#include "log.ext"

#endif LOG_H

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