Files
sics/servlog.h
Douglas Clowes b9954651d5 Make getlog commands less flakey
getlog {kill,none}
getlog what
getlog list
getlog err,wrn[,...]
2015-03-13 15:16:31 +11:00

41 lines
1.6 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);
unsigned int GetSICSLogHook(void *pData);
#endif