Source File
zap.go
Belonging Package
github.com/gotd/td/internal/mtproto
package mtproto
import (
)
type logType struct {
ID uint32
Name string
}
func ( logType) ( zapcore.ObjectEncoder) error {
:= fmt.Sprintf("0x%x", .ID)
.AddString("type_id", )
if .Name != "" {
.AddString("type_name", .Name)
}
return nil
}
func ( *Conn) ( *bin.Buffer) *zap.Logger {
return .logWithType().With(zap.Int("size_bytes", .Len()))
}
func ( *Conn) ( *bin.Buffer) *zap.Logger {
, := .PeekID()
if != nil {
// Type info not available.
return .log
}
return .logWithTypeID()
}
func ( *Conn) ( uint32) *zap.Logger {
return .log.With(zap.Inline(logType{
ID: ,
Name: .types.Get(),
}))
}
The pages are generated with Golds v0.6.7. (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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |