2022-04-24 02:13:06 +03:00
|
|
|
package quic
|
|
|
|
|
2023-06-02 03:59:07 +03:00
|
|
|
import "github.com/quic-go/quic-go"
|
|
|
|
|
2022-04-24 02:13:06 +03:00
|
|
|
type QlogWriter struct {
|
2023-06-02 03:59:07 +03:00
|
|
|
connID quic.ConnectionID
|
2022-04-24 02:13:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (w *QlogWriter) Write(b []byte) (int, error) {
|
2023-04-12 16:51:18 +03:00
|
|
|
// to much log, only turn on when debug Quic
|
|
|
|
|
|
|
|
// if len(b) > 1 { // skip line separator "0a" in qlog
|
|
|
|
// log.Record(&log.GeneralMessage{
|
|
|
|
// Severity: log.Severity_Debug,
|
|
|
|
// Content: fmt.Sprintf("[%x] %s", w.connID, b),
|
|
|
|
// })
|
|
|
|
// }
|
2022-04-24 02:13:06 +03:00
|
|
|
return len(b), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *QlogWriter) Close() error {
|
|
|
|
// Noop
|
|
|
|
return nil
|
|
|
|
}
|