ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/log.c
(Generate patch)

Comparing:
ircd-hybrid/src/s_log.c (file contents), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-8/src/s_log.c (file contents), Revision 1243 by michael, Fri Sep 30 10:47:53 2011 UTC

# Line 35 | Line 35
35   #endif
36  
37   #include "client.h"     /* Needed for struct Client */
38 #include "common.h"
38   #include "s_log.h"
39   #include "fileio.h"
40   #include "irc_string.h"
# Line 112 | Line 111 | write_log(const char *message)
111    if (logFile == NULL)
112      return;
113  
115 #ifdef _WIN32
116  nbytes = snprintf(buf, sizeof(buf), "[%s] %s\r\n",
117 #else
114    nbytes = snprintf(buf, sizeof(buf), "[%s] %s\n",
119 #endif
115                      smalldate(CurrentTime), message);
116 +
117    fbputs(buf, logFile, nbytes);
118   }
119    
# Line 136 | Line 132 | ilog(const int priority, const char *fmt
132      return;
133  
134    va_start(args, fmt);
135 <  vsprintf(buf, fmt, args);
135 >  vsnprintf(buf, sizeof(buf), fmt, args);
136    va_end(args);
137  
138   #ifdef USE_SYSLOG  
# Line 201 | Line 197 | get_log_level_as_string(int level)
197   void
198   log_user_exit(struct Client *source_p)
199   {
200 <  time_t on_for = CurrentTime - source_p->firsttime;
200 >  time_t on_for = CurrentTime - source_p->localClient->firsttime;
201   #ifdef SYSLOG_USERS
202    if (IsClient(source_p))
203    {
204 <    ilog(L_INFO, "%s (%3ld:%02ld:%02ld): %s!%s@%s %llu/%llu\n",
205 <         myctime(source_p->firsttime),
206 <          (signed long) on_for / 3600,
207 <          (signed long) (on_for % 3600)/60,
208 <          (signed long) on_for % 60,
209 <          source_p->name, source_p->username, source_p->host,
214 <          source_p->localClient->send.bytes>>10,
215 <          source_p->localClient->recv.bytes>>10);
204 >    ilog(L_INFO, "%s (%3u:%02u:%02u): %s!%s@%s %llu/%llu",
205 >         myctime(source_p->localClient->firsttime), (unsigned int)(on_for / 3600),
206 >         (unsigned int)((on_for % 3600)/60), (unsigned int)(on_for % 60),
207 >         source_p->name, source_p->username, source_p->host,
208 >         source_p->localClient->send.bytes>>10,
209 >         source_p->localClient->recv.bytes>>10);
210      }
211   #else
212    {
# Line 239 | Line 233 | log_user_exit(struct Client *source_p)
233        if (user_log_fb != NULL)
234        {
235          size_t nbytes = ircsprintf(linebuf,
236 <                   "%s (%3ld:%02ld:%02ld): %s!%s@%s %llu/%llu\n",
237 <                   myctime(source_p->firsttime),
238 <                   (signed long) on_for / 3600,
239 <                   (signed long) (on_for % 3600)/60,
240 <                   (signed long) on_for % 60,
236 >                   "%s (%3u:%02u:%02u): %s!%s@%s %llu/%llu\n",
237 >                   myctime(source_p->localClient->firsttime),
238 >                   (unsigned int)(on_for / 3600),
239 >                   (unsigned int)((on_for % 3600)/60),
240 >                   (unsigned int)(on_for % 60),
241                     source_p->name, source_p->username, source_p->host,
242                     source_p->localClient->send.bytes>>10,
243                     source_p->localClient->recv.bytes>>10);

Comparing:
ircd-hybrid/src/s_log.c (property svn:keywords), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-8/src/s_log.c (property svn:keywords), Revision 1243 by michael, Fri Sep 30 10:47:53 2011 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)