+#ifdef SILC_DEBUG
+#define NUM_DEBUGS 3000
+static char debugs[NUM_DEBUGS][128];
+static int cur_debug = 0;
+
+SilcBool silc_server_debug_callback(char *file, char *function, int line,
+ char *message, void *context)
+{
+ SilcTimeStruct curtime;
+
+ /* Save the message to ring buffer */
+ silc_time_value(0, &curtime);
+ silc_snprintf(debugs[cur_debug % NUM_DEBUGS], sizeof(debugs[0]),
+ "%02d:%02d:%02d %s:%d: %s", curtime.hour,
+ curtime.minute, curtime.second, function, line,
+ message);
+ cur_debug++;
+
+ return FALSE;
+}
+#endif /* SILC_DEBUG */
+