mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 13:32:24 +00:00
xray log - minor change
This commit is contained in:
parent
0bde51b91e
commit
b68f0a206c
1 changed files with 19 additions and 2 deletions
|
@ -41,8 +41,16 @@ func (lw *LogWriter) Write(m []byte) (n int, err error) {
|
|||
if len(matches) > 3 {
|
||||
level := matches[2]
|
||||
msgBody := matches[3]
|
||||
msgBodyLower := strings.ToLower(msgBody)
|
||||
|
||||
if strings.Contains(strings.ToLower(msgBody), "failed") {
|
||||
if strings.Contains(msgBodyLower, "tls handshake error") ||
|
||||
strings.Contains(msgBodyLower, "connection ends") {
|
||||
logger.Debug("XRAY: " + msgBody)
|
||||
lw.lastLine = ""
|
||||
continue
|
||||
}
|
||||
|
||||
if strings.Contains(msgBodyLower, "failed") {
|
||||
logger.Error("XRAY: " + msgBody)
|
||||
} else {
|
||||
switch level {
|
||||
|
@ -60,7 +68,16 @@ func (lw *LogWriter) Write(m []byte) (n int, err error) {
|
|||
}
|
||||
lw.lastLine = ""
|
||||
} else if msg != "" {
|
||||
if strings.Contains(strings.ToLower(msg), "failed") {
|
||||
msgLower := strings.ToLower(msg)
|
||||
|
||||
if strings.Contains(msgLower, "tls handshake error") ||
|
||||
strings.Contains(msgLower, "connection ends") {
|
||||
logger.Debug("XRAY: " + msg)
|
||||
lw.lastLine = msg
|
||||
continue
|
||||
}
|
||||
|
||||
if strings.Contains(msgLower, "failed") {
|
||||
logger.Error("XRAY: " + msg)
|
||||
} else {
|
||||
logger.Debug("XRAY: " + msg)
|
||||
|
|
Loading…
Reference in a new issue