gf icon indicating copy to clipboard operation
gf copied to clipboard

frame/g/Dump: It is recommended to enhance the log friendliness of g.Dump.

Open lingcoder opened this issue 1 year ago • 1 comments

Description

现在的Dump在打印日志时,对部分类型的数据显示不是太友好,特别是字节数组,每个字节都会占用一行。 推荐借鉴或引入 https://github.com/davecgh/go-spew 库来增强g.Dump()

Additional

这是 spew.Dump() 的打印效果: 1717556160981

这是 g.Dump() 效果 28ffc2a772a7e03734c63063470e553

lingcoder avatar Jun 05 '24 02:06 lingcoder

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Description

When printing logs, the current Dump is not very friendly to the display of some types of data, especially byte arrays, where each byte occupies one line. It is recommended to learn from or introduce the https://github.com/davecgh/go-spew library to enhance g.Dump()

Additional

This is what spew.Dump() prints out: 1717556160981

This is the effect of g.Dump() 28ffc2a772a7e03734c63063470e553

Issues-translate-bot avatar Jun 05 '24 02:06 Issues-translate-bot