mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-21 16:25:49 +00:00
bug fix log_writer #872
This commit is contained in:
@@ -31,7 +31,7 @@ func (lw *LogWriter) Write(m []byte) (n int, err error) {
|
|||||||
// Find level in []
|
// Find level in []
|
||||||
startIndex := strings.Index(messageBody, "[")
|
startIndex := strings.Index(messageBody, "[")
|
||||||
endIndex := 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])
|
level := strings.TrimSpace(messageBody[startIndex+1 : endIndex])
|
||||||
msgBody := "XRAY: " + strings.TrimSpace(messageBody[endIndex+1:])
|
msgBody := "XRAY: " + strings.TrimSpace(messageBody[endIndex+1:])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user