From 033e5f845d2f60c7ac6c8cb8ba0051814a63dc3d Mon Sep 17 00:00:00 2001 From: wangjian Date: Wed, 5 Apr 2023 21:17:46 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ap.go | 4 ++-- stream_func.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ap.go b/ap.go index cbb9c3d..7a17b04 100644 --- a/ap.go +++ b/ap.go @@ -99,8 +99,8 @@ func (s *accessPoint) WriteWithTag(tag frame.Tag, data []byte) error { f := frame.NewDataFrame() f.SetCarriage(tag, data) f.SetSourceId(s.client.ClientId()) - log.Debugf("%s WriteWithTag: tid=%s, source_id=%s, data[%d]=%# x", - apLogPrefix, f.TransactionId(), f.SourceId(), len(data), frame.Shortly(data)) + log.Debugf("%s WriteWithTag: tid=%s, source_id=%s, data[%d]", + apLogPrefix, f.TransactionId(), f.SourceId(), len(data)) return s.client.WriteFrame(f) } diff --git a/stream_func.go b/stream_func.go index ced3458..3fec9bb 100644 --- a/stream_func.go +++ b/stream_func.go @@ -83,7 +83,7 @@ func (s *streamFunction) Connect() error { s.client.Logger().Debugf("%s Connect()", streamFunctionLogPrefix) // notify underlying network operations, when data with tag we observed arrived, invoke the func s.client.SetDataFrameObserver(func(data *frame.DataFrame) { - s.client.Logger().Debugf("%s receive DataFrame, tag=%# x, carriage=%# x", streamFunctionLogPrefix, data.Tag(), data.GetCarriage()) + s.client.Logger().Debugf("%s receive DataFrame, tag=%# x, carriage length=%d", streamFunctionLogPrefix, data.Tag(), len(data.GetCarriage())) s.onDataFrame(data.GetCarriage(), data.GetMetaFrame()) }) @@ -144,13 +144,13 @@ func (s *streamFunction) onDataFrame(data []byte, metaFrame *frame.MetaFrame) { if s.fn != nil { go func() { - s.client.Logger().Debugf("%s execute-start fn: data[%d]=%# x", streamFunctionLogPrefix, len(data), frame.Shortly(data)) + s.client.Logger().Debugf("%s execute-start fn: data[%d]", streamFunctionLogPrefix, len(data)) //, frame.Shortly(data) // invoke serverless tag, resp := s.fn(data) - s.client.Logger().Debugf("%s execute-done fn: tag=%#x, resp[%d]=%# x", streamFunctionLogPrefix, tag, len(resp), frame.Shortly(resp)) + s.client.Logger().Debugf("%s execute-done fn: tag=%#x, resp[%d]", streamFunctionLogPrefix, tag, len(resp)) // if resp is not nil, means the user's function has returned something, we should send it to the mq if len(resp) != 0 { - s.client.Logger().Debugf("%s start WriteFrame(): tag=%#x, data[%d]=%# x", streamFunctionLogPrefix, tag, len(resp), frame.Shortly(resp)) + s.client.Logger().Debugf("%s start WriteFrame(): tag=%#x, data[%d]", streamFunctionLogPrefix, tag, len(resp)) // build a DataFrame // TODO: seems we should implement a DeepCopy() of MetaFrame in the future frm := frame.NewDataFrame() @@ -163,7 +163,7 @@ func (s *streamFunction) onDataFrame(data []byte, metaFrame *frame.MetaFrame) { } }() } else if s.pfn != nil { - s.client.Logger().Debugf("%s pipe fn receive: data[%d]=%# x", streamFunctionLogPrefix, len(data), data) + s.client.Logger().Debugf("%s pipe fn receive: data[%d]", streamFunctionLogPrefix, len(data)) s.pIn <- data } else { s.client.Logger().Warnf("%s StreamFunction is nil", streamFunctionLogPrefix)