Files
sics/servlog.h
Douglas Clowes 0fb4519876 Changes to logging
Add 'L' to 'M', 'N', 'D' log flags (for consistency)
Replace colon (':') in logfilenames with minus ('-')
Suppress spurious blank lines in logfile from line terminators
Add filename to open/close messages for chaining convenience
2014-07-03 15:28:05 +10:00

40 lines
1.5 KiB
C

/*--------------------------------------------------------------------------
The server LOG. Logs all connection requests, internal server
errors, SW-errors, HW-problems, commands etc.
Additionally implements a capture command which allows to get
log output for a client.
Mark Koennecke, October 1996, November 1996
copyright: see implementation file
--------------------------------------------------------------------------*/
#ifndef SICSLOG
#define SICSLOG
#include "Scommon.h"
void SICSLogWrite(char *ptext, OutCode eOut);
void SICSLogWriteTime(char *ptext, OutCode eOut, struct timeval *tp);
void SICSLogWriteCode(char *ptext, OutCode eOut, char code);
void SICSLogWriteTimeCode(char *ptext, OutCode eOut, struct timeval *tp, char code);
void SICSLogWriteHex(const char *text, int count, OutCode eOut);
void SICSLogWriteHexTime(const char *text, int count, OutCode eOut,
struct timeval *tp);
#if __GNUC__ > 2
#define G_GNUC_PRINTF( format_idx, arg_idx ) \
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
#else
#define G_GNUC_PRINTF( format_idx, arg_idx )
#endif
void SICSLogPrintf(OutCode eOut, const char *fmt, ...) G_GNUC_PRINTF (2, 3);
void SICSLogTimePrintf(OutCode eOut, struct timeval *tp, const char *fmt,
...) G_GNUC_PRINTF (3, 4);
#undef G_GNUC_PRINTF
void SICSLogEnable(int flag);
typedef void (*pSICSLogHook)(const char *pText, OutCode eOut, void *pData);
char *AddSICSLogHook(pSICSLogHook func, const char *pCodes, void *pData);
char *RemSICSLogHook(void *pData);
#endif