X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilclog.h;fp=lib%2Fsilccore%2Fsilclog.h;h=cd34639f3d1fc994cd0c45ad54b3e11ec7361b5a;hb=89b07a460a554eb5173fe07f09b8c51c31d53e29;hp=a98e4af44fa62c6a04b3daf2f9aca6a32f933a84;hpb=4eea9e61a1c77e4eec137ff0d34c03cae96c2db9;p=silc.git diff --git a/lib/silccore/silclog.h b/lib/silcutil/silclog.h similarity index 82% rename from lib/silccore/silclog.h rename to lib/silcutil/silclog.h index a98e4af4..cd34639f 100644 --- a/lib/silccore/silclog.h +++ b/lib/silcutil/silclog.h @@ -21,6 +21,9 @@ #ifndef SILCLOG_H #define SILCLOG_H +/* Set TRUE/FALSE to enable/disable debugging */ +extern int silc_debug; + /* SILC Log types */ typedef enum { SILC_LOG_INFO, @@ -35,6 +38,18 @@ typedef struct { SilcLogType type; } SilcLogTypeName; +/* Log function callback. */ +typedef void (*SilcLogCb)(char *message); + +/* Debug function callback. */ +typedef void (*SilcDebugCb)(char *file, char *function, + int line, char *message); + +/* Debug hexdump function callback. */ +typedef void (*SilcDebugHexdumpCb)(char *file, char *function, + int line, unsigned char *data, + unsigned int data_len, char *message); + /* Default log filenames */ #define SILC_LOG_FILE_INFO "silcd.log" #define SILC_LOG_FILE_WARNING "silcd_error.log" @@ -100,5 +115,11 @@ void silc_log_set_files(char *info, unsigned int info_size, char *warning, unsigned int warning_size, char *error, unsigned int error_size, char *fatal, unsigned int fatal_size); +void silc_log_set_callbacks(SilcLogCb info, SilcLogCb warning, + SilcLogCb error, SilcLogCb fatal); +void silc_log_reset_callbacks(); +void silc_log_set_debug_callbacks(SilcDebugCb debug, + SilcDebugHexdumpCb debug_hexdump); +void silc_log_reset_debug_callbacks(); #endif