github.com/moqsien/xraycore@v1.8.5/transport/internet/quic/qlogWriter.go (about) 1 package quic 2 3 import "github.com/quic-go/quic-go" 4 5 type QlogWriter struct { 6 connID quic.ConnectionID 7 } 8 9 func (w *QlogWriter) Write(b []byte) (int, error) { 10 // to much log, only turn on when debug Quic 11 12 // if len(b) > 1 { // skip line separator "0a" in qlog 13 // log.Record(&log.GeneralMessage{ 14 // Severity: log.Severity_Debug, 15 // Content: fmt.Sprintf("[%x] %s", w.connID, b), 16 // }) 17 // } 18 return len(b), nil 19 } 20 21 func (w *QlogWriter) Close() error { 22 // Noop 23 return nil 24 }