Bugzilla – Attachment 2740 Details for
Bug 2464
Adding timestamp to debug messages (log.c:do_log)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
adding timestamp to debug messages
ssh-time-log.patch (text/plain), 913 bytes, created by
Darren Tucker
on 2015-10-29 11:13:42 AEDT
(
hide
)
Description:
adding timestamp to debug messages
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2015-10-29 11:13:42 AEDT
Size:
913 bytes
patch
obsolete
>diff --git a/log.c b/log.c >index ad12930..49c4309 100644 >--- a/log.c >+++ b/log.c >@@ -46,6 +46,7 @@ > #include <syslog.h> > #include <unistd.h> > #include <errno.h> >+#include <sys/timeb.h> > #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) > # include <vis.h> > #endif >@@ -443,7 +444,15 @@ do_log(LogLevel level, const char *fmt, va_list args) > tmp_handler(level, fmtbuf, log_handler_ctx); > log_handler = tmp_handler; > } else if (log_on_stderr) { >- snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); >+ struct timeb tb; >+ struct tm tm; >+ char *p= msgbuf; >+ >+ ftime (&tb); >+ localtime_r (&tb.time, &tm); >+ p += strftime (p, 16, "%Y%m%d.%H%M%S", &tm); >+ p += sprintf (p, ".%03d ", tb.millitm); >+ snprintf(p, (msgbuf + sizeof msgbuf - p), "%s\r\n", fmtbuf); > (void)write(log_stderr_fd, msgbuf, strlen(msgbuf)); > } else { > #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2464
:
2702
| 2740 |
2741