From 6ced549deaecb42b9bb93ea9efcb4c1bbaabe8a4 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Sat, 20 Sep 2025 09:35:50 +0200 Subject: docs: add comments for all functions --- xray/log_writer.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xray/log_writer.go') diff --git a/xray/log_writer.go b/xray/log_writer.go index 3be39b3e..b2b3b04a 100644 --- a/xray/log_writer.go +++ b/xray/log_writer.go @@ -8,14 +8,17 @@ import ( "github.com/mhsanaei/3x-ui/v2/logger" ) +// NewLogWriter returns a new LogWriter for processing Xray log output. func NewLogWriter() *LogWriter { return &LogWriter{} } +// LogWriter processes and filters log output from the Xray process, handling crash detection and message filtering. type LogWriter struct { lastLine string } +// Write processes and filters log output from the Xray process, handling crash detection and message filtering. func (lw *LogWriter) Write(m []byte) (n int, err error) { crashRegex := regexp.MustCompile(`(?i)(panic|exception|stack trace|fatal error)`) -- cgit v1.2.3