/[svn]/hopm/trunk/src/log.c
ViewVC logotype

Diff of /hopm/trunk/src/log.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6971 by michael, Sat Dec 19 20:29:27 2015 UTC revision 6972 by michael, Sun Dec 20 16:46:47 2015 UTC
# Line 70  scanlog_close(void) Line 70  scanlog_close(void)
70  }  }
71    
72  void  void
73  log_printf(const char *data, ...)  log_printf(const char *fmt, ...)
74  {  {
75    char data2[513];    char buf[512];
76    va_list arglist;    va_list args;
77    
78    if (OPT_DEBUG == 0 && logfile == NULL)    if (OPT_DEBUG == 0 && logfile == NULL)
79      return;      return;
80    
81    va_start(arglist, data);    va_start(args, fmt);
82    vsnprintf(data2, 512, data, arglist);    vsnprintf(buf, sizeof(buf), fmt, args);
83    va_end(arglist);    va_end(args);
84    
85    if (OPT_DEBUG)    if (OPT_DEBUG)
86      fprintf(stderr, "[%s] %s\n", date_iso8601(0), data2);      fprintf(stderr, "[%s] %s\n", date_iso8601(0), buf);
87    else    else
88    {    {
89      fprintf(logfile, "[%s] %s\n", date_iso8601(0), data2);      fprintf(logfile, "[%s] %s\n", date_iso8601(0), buf);
90      fflush(logfile);      fflush(logfile);
91    }    }
92  }  }

Legend:
Removed from v.6971  
changed lines
  Added in v.6972

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28