diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2024-02-03 14:54:39 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2024-02-04 01:15:16 +0300 |
| commit | 6804facabc27a5dc72a8db22bbaaf2c245161323 (patch) | |
| tree | d9a18a150cafe9addca00b62887a051854a5b562 /xray | |
| parent | 98dd6bb9493c989d2947dce3beda030a331805ec (diff) | |
bug fix log_writer
+ notice log level
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'xray')
| -rw-r--r-- | xray/log_writer.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xray/log_writer.go b/xray/log_writer.go index 5fc6b3d1..53358ca2 100644 --- a/xray/log_writer.go +++ b/xray/log_writer.go @@ -31,7 +31,7 @@ func (lw *LogWriter) Write(m []byte) (n int, err error) { // Find level in [] startIndex := strings.Index(messageBody, "[") endIndex := strings.Index(messageBody, "]") - if startIndex != -1 && endIndex != -1 { + if startIndex != -1 && endIndex != -1 && startIndex < endIndex { level := strings.TrimSpace(messageBody[startIndex+1 : endIndex]) msgBody := "XRAY: " + strings.TrimSpace(messageBody[endIndex+1:]) |
