Bugzilla – Attachment 2741 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]
Changes as suggested.
ssh-debug-time.patch (text/plain), 847 bytes, created by
Darren Tucker
on 2015-10-29 11:59:39 AEDT
(
hide
)
Description:
Changes as suggested.
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2015-10-29 11:59:39 AEDT
Size:
847 bytes
patch
obsolete
>diff --git a/log.c b/log.c >index ad12930..d9c51e3 100644 >--- a/log.c >+++ b/log.c >@@ -36,6 +36,7 @@ > > #include "includes.h" > >+#include <sys/time.h> > #include <sys/types.h> > > #include <fcntl.h> >@@ -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 timeval tv; >+ struct tm *tm; >+ char timebuf[20]; >+ >+ gettimeofday(&tv, NULL); >+ tm = localtime(&(tv.tv_sec)); >+ (void)strftime(timebuf, sizeof timebuf, "%Y%m%dT%H%M%S", tm); >+ snprintf(msgbuf, sizeof msgbuf, "%s.%03d %s\r\n", timebuf, >+ (int)(tv.tv_usec/1000), 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