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 32 by knight, Sun Oct 2 20:41:23 2005 UTC vs.
ircd-hybrid-8/src/s_log.c (file contents), Revision 1241 by michael, Thu Sep 29 20:26:09 2011 UTC

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

Comparing:
ircd-hybrid/src/s_log.c (property svn:keywords), Revision 32 by knight, Sun Oct 2 20:41:23 2005 UTC vs.
ircd-hybrid-8/src/s_log.c (property svn:keywords), Revision 1241 by michael, Thu Sep 29 20:26:09 2011 UTC

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

Diff Legend

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