Skip to content

Commit c7fba85

Browse files
committed
debug 日志打点
1 parent 806d959 commit c7fba85

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

message/router.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,19 +613,19 @@ func (h *handler) run(ctx context.Context, middlewares []middleware) {
613613
go h.handleClose(ctx)
614614

615615
for msg := range h.messagesCh {
616-
h.logger.Info("GoChannel #8", watermill.LogFields{
616+
h.logger.Trace("GoChannel #8", watermill.LogFields{
617617
"subscriber_name": h.name,
618618
"topic": h.subscribeTopic,
619619
})
620620
h.runningHandlersWgLock.Lock()
621-
h.logger.Info("GoChannel #9", watermill.LogFields{
621+
h.logger.Trace("GoChannel #9", watermill.LogFields{
622622
"subscriber_name": h.name,
623623
"topic": h.subscribeTopic,
624624
})
625625
h.runningHandlersWg.Add(1)
626626
h.runningHandlersWgLock.Unlock()
627627

628-
h.logger.Info("GoChannel #10", watermill.LogFields{
628+
h.logger.Trace("GoChannel #10", watermill.LogFields{
629629
"subscriber_name": h.name,
630630
"topic": h.subscribeTopic,
631631
})
@@ -771,7 +771,7 @@ func (h *handler) handleMessage(msg *Message, handler HandlerFunc) {
771771
defer h.runningHandlersWg.Done()
772772
msgFields := watermill.LogFields{"message_uuid": msg.UUID}
773773

774-
h.logger.Info("GoChannel #11", msgFields)
774+
h.logger.Trace("GoChannel #11", msgFields)
775775
defer func() {
776776
if recovered := recover(); recovered != nil {
777777
h.logger.Error(

pubsub/gochannel/pubsub.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,17 @@ func (g *GoChannel) sendMessage(topic string, message *message.Message) (<-chan
147147
}
148148

149149
go func(subscribers []*subscriber) {
150-
g.logger.Info("GoChannel #1", logFields)
150+
g.logger.Trace("GoChannel #1", logFields)
151151
wg := &sync.WaitGroup{}
152152

153153
for i := range subscribers {
154154
subscriber := subscribers[i]
155155

156-
g.logger.Info("GoChannel #2", logFields)
156+
g.logger.Trace("GoChannel #2", logFields)
157157

158158
wg.Add(1)
159159
go func() {
160-
g.logger.Info("GoChannel #3", logFields)
160+
g.logger.Trace("GoChannel #3", logFields)
161161
subscriber.sendMessageToSubscriber(message, logFields)
162162
wg.Done()
163163
}()
@@ -346,19 +346,19 @@ func (s *subscriber) Close() {
346346

347347
func (s *subscriber) sendMessageToSubscriber(msg *message.Message, logFields watermill.LogFields) {
348348

349-
s.logger.Info("GoChannel #4", logFields)
349+
s.logger.Trace("GoChannel #4", logFields)
350350

351351
s.sending.Lock()
352352
defer s.sending.Unlock()
353353

354-
s.logger.Info("GoChannel #5", logFields)
354+
s.logger.Trace("GoChannel #5", logFields)
355355

356356
ctx, cancelCtx := context.WithCancel(s.ctx)
357357
defer cancelCtx()
358358

359359
SendToSubscriber:
360360
for {
361-
s.logger.Info("GoChannel #6", logFields)
361+
s.logger.Trace("GoChannel #6", logFields)
362362
// copy the message to prevent ack/nack propagation to other consumers
363363
// also allows to make retries on a fresh copy of the original message
364364
msgToSend := msg.Copy()
@@ -371,7 +371,7 @@ SendToSubscriber:
371371
return
372372
}
373373

374-
s.logger.Info("GoChannel #7", logFields)
374+
s.logger.Trace("GoChannel #7", logFields)
375375
select {
376376
case s.outputChannel <- msgToSend:
377377
s.logger.Trace("Sent message to subscriber", logFields)

0 commit comments

Comments
 (0)