From 5679d717eef23f48d4f60a0a34684f46c478e053 Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Sat, 25 Jan 2025 11:52:44 +0000 Subject: [PATCH] Log: Add microseconds for all kinds of logs https://github.com/XTLS/Xray-core/issues/4313#issuecomment-2613932895 --- common/log/logger.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/log/logger.go b/common/log/logger.go index d964a212..7c100aa1 100644 --- a/common/log/logger.go +++ b/common/log/logger.go @@ -146,7 +146,7 @@ func (w *fileLogWriter) Close() error { func CreateStdoutLogWriter() WriterCreator { return func() Writer { return &consoleLogWriter{ - logger: log.New(os.Stdout, "", log.Ldate|log.Ltime), + logger: log.New(os.Stdout, "", log.Ldate|log.Ltime|log.Lmicroseconds), } } } @@ -155,7 +155,7 @@ func CreateStdoutLogWriter() WriterCreator { func CreateStderrLogWriter() WriterCreator { return func() Writer { return &consoleLogWriter{ - logger: log.New(os.Stderr, "", log.Ldate|log.Ltime), + logger: log.New(os.Stderr, "", log.Ldate|log.Ltime|log.Lmicroseconds), } } } @@ -174,7 +174,7 @@ func CreateFileLogWriter(path string) (WriterCreator, error) { } return &fileLogWriter{ file: file, - logger: log.New(file, "", log.Ldate|log.Ltime), + logger: log.New(file, "", log.Ldate|log.Ltime|log.Lmicroseconds), } }, nil }