Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2005 Pekka Riikonen
+ Copyright (C) 1997 - 2006 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
/* $Id$ */
-#include "silcincludes.h"
+#include "silc.h"
/* SilcLogSettings context */
typedef struct {
/* Cycle log file */
fprintf(log->fp,
"[%s] [%s] Cycling log file, over max log size (%lu kilobytes)\n",
- silc_get_time(0), log->typename, (unsigned long)log->maxsize / 1024);
+ silc_time_string(0), log->typename,
+ (unsigned long)log->maxsize / 1024);
fflush(log->fp);
fclose(log->fp);
memset(newname, 0, sizeof(newname));
- snprintf(newname, sizeof(newname) - 1, "%s.old", log->filename);
+ silc_snprintf(newname, sizeof(newname) - 1, "%s.old", log->filename);
unlink(newname);
rename(log->filename, newname);
found:
if (silclog.timestamp)
- fprintf(fp, "[%s] [%s] %s\n", silc_get_time(0), typename, string);
+ fprintf(fp, "[%s] [%s] %s\n", silc_time_string(0), typename, string);
else
fprintf(fp, "[%s] %s\n", typename, string);
/* Set and initialize the specified log file. */
-bool silc_log_set_file(SilcLogType type, char *filename, SilcUInt32 maxsize,
- SilcSchedule scheduler)
+SilcBool silc_log_set_file(SilcLogType type, char *filename,
+ SilcUInt32 maxsize, SilcSchedule scheduler)
{
FILE *fp = NULL;
SilcLog log;
/* Set timestamp */
-void silc_log_timestamp(bool enable)
+void silc_log_timestamp(SilcBool enable)
{
silclog.timestamp = enable;
}
/* Set quick logging */
-void silc_log_quick(bool enable)
+void silc_log_quick(SilcBool enable)
{
silclog.quick = enable;
}
/* Set debugging */
-void silc_log_debug(bool enable)
+void silc_log_debug(SilcBool enable)
{
silclog.debug = enable;
}
/* Set debug hexdump */
-void silc_log_debug_hexdump(bool enable)
+void silc_log_debug_hexdump(SilcBool enable)
{
silclog.debug_hexdump = enable;
}