Source File
zap.go
Belonging Package
github.com/gotd/td/mtproto
package mtprotoimport ()type logType struct {ID uint32Name string}// LogAttr returns the type info as an inline log group.func ( logType) () log.Attr {:= []log.Attr{log.String("type_id", fmt.Sprintf("0x%x", .ID))}if .Name != "" {= append(, log.String("type_name", .Name))}return log.Group("", ...)}func ( *Conn) ( *bin.Buffer) log.Helper {return .logWithType().With(log.Int("size_bytes", .Len()))}func ( *Conn) ( *bin.Buffer) log.Helper {, := .PeekID()if != nil {// Type info not available.return .log}return .logWithTypeID()}func ( *Conn) ( uint32) log.Helper {return .log.With(logType{ID: ,Name: .types.Get(),}.LogAttr())}
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |