]> jfr.im git - solanum.git/blobdiff - ircd/logger.c
free server_p->certfp, allocated in newconf.c
[solanum.git] / ircd / logger.c
index e7f14f61f6b6263673c7ba97e6ff7f98befcdf1c..3b81acd71cbe14a65d7c42916bcf67a0740afa2b 100644 (file)
@@ -30,8 +30,6 @@
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: s_log.c 3209 2007-02-11 16:54:43Z jilles $
  */
 
 #include "stdinc.h"
@@ -84,7 +82,7 @@ verify_logfile_access(const char *filename)
 
        if(access(dirname, F_OK) == -1)
        {
-               rb_snprintf(buf, sizeof(buf), "WARNING: Unable to access logfile %s - parent directory %s does not exist", filename, dirname);
+               snprintf(buf, sizeof(buf), "WARNING: Unable to access logfile %s - parent directory %s does not exist", filename, dirname);
                if(testing_conf || server_state_foreground)
                        fprintf(stderr, "%s\n", buf);
                sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", buf);
@@ -95,7 +93,7 @@ verify_logfile_access(const char *filename)
        {
                if(access(dirname, W_OK) == -1)
                {
-                       rb_snprintf(buf, sizeof(buf), "WARNING: Unable to access logfile %s - access to parent directory %s failed: %s",
+                       snprintf(buf, sizeof(buf), "WARNING: Unable to access logfile %s - access to parent directory %s failed: %s",
                                    filename, dirname, strerror(errno));
                        if(testing_conf || server_state_foreground)
                                fprintf(stderr, "%s\n", buf);
@@ -106,7 +104,7 @@ verify_logfile_access(const char *filename)
 
        if(access(filename, W_OK) == -1)
        {
-               rb_snprintf(buf, sizeof(buf), "WARNING: Access denied for logfile %s: %s", filename, strerror(errno));
+               snprintf(buf, sizeof(buf), "WARNING: Access denied for logfile %s: %s", filename, strerror(errno));
                if(testing_conf || server_state_foreground)
                        fprintf(stderr, "%s\n", buf);
                sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", buf);
@@ -177,10 +175,10 @@ ilog(ilogfile dest, const char *format, ...)
                return;
 
        va_start(args, format);
-       rb_vsnprintf(buf, sizeof(buf), format, args);
+       vsnprintf(buf, sizeof(buf), format, args);
        va_end(args);
 
-       rb_snprintf(buf2, sizeof(buf2), "%s %s\n",
+       snprintf(buf2, sizeof(buf2), "%s %s\n",
                        smalldate(rb_current_time()), buf);
 
        if(fputs(buf2, logfile) < 0)
@@ -202,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, ...)
 {
@@ -209,7 +224,7 @@ inotice(const char *format, ...)
        va_list args;
 
        va_start(args, format);
-       rb_vsnprintf(buf, sizeof(buf), format, args);
+       vsnprintf(buf, sizeof(buf), format, args);
        va_end(args);
 
        _iprint("notice", buf);
@@ -224,7 +239,7 @@ iwarn(const char *format, ...)
        va_list args;
 
        va_start(args, format);
-       rb_vsnprintf(buf, sizeof(buf), format, args);
+       vsnprintf(buf, sizeof(buf), format, args);
        va_end(args);
 
        _iprint("warning", buf);
@@ -239,7 +254,7 @@ ierror(const char *format, ...)
        va_list args;
 
        va_start(args, format);
-       rb_vsnprintf(buf, sizeof(buf), format, args);
+       vsnprintf(buf, sizeof(buf), format, args);
        va_end(args);
 
        _iprint("error", buf);
@@ -274,7 +289,7 @@ smalldate(time_t ltime)
 
        lt = localtime(&ltime);
 
-       rb_snprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d",
+       snprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d",
                    lt->tm_year + 1900, lt->tm_mon + 1,
                    lt->tm_mday, lt->tm_hour, lt->tm_min);