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(),
	}))
}