提交 c6442ed6 编写于 作者: U Ulric Qin

add agent log

上级 ebb95a82
package report
import (
"encoding/json"
"fmt"
"math/rand"
"os"
......@@ -127,6 +128,8 @@ func report() error {
var body errRes
err := httplib.Post(url).JSONBodyQuiet(form).Header("X-Srv-Token", config.Config.Report.Token).SetTimeout(time.Second * 5).ToJSON(&body)
if err != nil {
js, _ := json.Marshal(form)
logger.Errorf("report payload: %s, token: %s", string(js), config.Config.Report.Token)
return fmt.Errorf("curl %s fail: %v", url, err)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册