]> jfr.im git - solanum.git/blobdiff - ircd/logger.c
support RSFNC indicating type of FNC (e.g. FORCE vs REGAIN) (#406)
[solanum.git] / ircd / logger.c
index c4de984ceddb9975a372c31cf5007f4ce82b91be..44294b19904c4907966917bcb85a32a2dcf1370c 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * charybdis: an advanced Internet Relay Chat Daemon(ircd).
+ * Solanum: a slightly advanced ircd
  *
  * Copyright (C) 2003 Lee H <lee@leeh.co.uk>
  * Copyright (C) 2003-2005 ircd-ratbox development team
- * Copyright (C) 2008 William Pitcock <nenolod@sacredspiral.co.uk>
+ * Copyright (C) 2008 Ariadne Conill <ariadne@dereferenced.org>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -168,7 +168,7 @@ ilog(ilogfile dest, const char *format, ...)
 {
        FILE *logfile = *log_table[dest].logfile;
        char buf[BUFSIZE];
-       char buf2[BUFSIZE];
+       char buf2[MAX_DATE_STRING + 1 + BUFSIZE + 1];
        va_list args;
 
        if(logfile == NULL)
@@ -200,6 +200,23 @@ _iprint(const char *domain, const char *buf)
        fprintf(stderr, "%8s: %s\n", domain, buf);
 }
 
+void
+idebug(const char *format, ...)
+{
+#ifndef NDEBUG
+       char buf[BUFSIZE];
+       va_list args;
+
+       va_start(args, format);
+       vsnprintf(buf, sizeof(buf), format, args);
+       va_end(args);
+
+       _iprint("debug", buf);
+
+       ilog(L_MAIN, "%s", buf);
+#endif
+}
+
 void
 inotice(const char *format, ...)
 {