瀏覽代碼

debug changes

Abhishek Kondur 1 年之前
父節點
當前提交
9198de71dc
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      mq/util.go

+ 8 - 0
mq/util.go

@@ -3,6 +3,7 @@ package mq
 import (
 	"errors"
 	"fmt"
+	"runtime"
 	"strings"
 	"time"
 
@@ -73,6 +74,13 @@ func encryptMsg(host *models.Host, msg []byte) ([]byte, error) {
 }
 
 func publish(host *models.Host, dest string, msg []byte) error {
+	if len(msg) == 0 {
+		pc, _, _, ok := runtime.Caller(1)
+		details := runtime.FuncForPC(pc)
+		if ok && details != nil {
+			fmt.Printf("\n------> ####$$$ Called from %s\n", details.Name())
+		}
+	}
 	// encrypted, encryptErr := encryptMsg(host, msg)
 	// if encryptErr != nil {
 	// 	return encryptErr