-
Notifications
You must be signed in to change notification settings - Fork 11
add dbg flag for llcppsigfetch, llcppsymg, gogensig to control log #245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
_xtool/llcppsymg/dbg/debug.go
Outdated
| DbgSymbol dbgFlags = 1 << iota | ||
| DbgParseIsMethod //print parse.go isMethod debug log info | ||
| DbgFlagAll = DbgSymbol | DbgParseIsMethod | ||
| DbgEditSymMap //print user edit sym map info | ||
| DbgVisitTop //print visitTop | ||
| DbgCollectFuncInfo | ||
| DbgNewSymbol | ||
| DbgFileType | ||
| DbgFlagAll = DbgSymbol | DbgParseIsMethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前的DbgFlagAll = DbgSymbol | DbgParseIsMethod 是因为只有两个flag,现在的DbgFlagAll其实就不应该这么写了,而是应该组合前面所有的Flag。
https://github.com/goplus/gogen/blob/ba6f4f0b5b8a936aac433e2b202a9de05ab0915a/package.go#L30C1-L40C2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前的DbgFlagAll = DbgSymbol | DbgParseIsMethod 是因为只有两个flag,现在的DbgFlagAll其实就不应该这么写了,而是应该组合前面所有的Flag。
https://github.com/goplus/gogen/blob/ba6f4f0b5b8a936aac433e2b202a9de05ab0915a/package.go#L30C1-L40C2
这个在开发调试的时候可以修改。对于产品发布,或者对于测试输出就禁止了吧。否则log太多对排查问题来说很不方便。这是故意这样做的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DbgFlagAll的语义就会不明确
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DbgFlagAll的语义就会不明确
怎么不明确了,这个DbgFlagAll是由你控制的一个flag,如果是0,就是不输出log,如果是DbgVisitTop|DbgFileType,就是输出其他,这个DbgFlagAll的意思就是所有要输出的log的意思。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
根据最新的这个提交,在位标志中,0表示“没有标志被设置”。如果 DbgAll 定义为0,就意味着没有一个调试标志被启用,这与“所有标志都开启”的意思完全相反。因此,为了表示所有调试标志都被激活,DbgAll 必须由所有标志的非零值按位“或”得到,而不能简单地用0表示。
这个是故意这样做的,只有在调试的时候,才需要输出log,按照你想输出什么log,DbgFlagAll=flagA|flagB,只输出A和B的log。然后运行的时候添加-v标志,只输出你想要的log。
cmd/gogensig/dbg/debug.go
Outdated
| DbgNew | ||
| DbgWrite | ||
| DbgUnmarshalling | ||
| DbgFlagAll = 0 | DbgError | DbgLog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
与 #245 (comment) 相同的问题
| DbgLog // print log info | ||
| DbgFlagAll = 0 | DbgError | DbgLog | ||
| DbgSetCurFile | ||
| DbgNew |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的New是预期输出哪部分的log
_xtool/llcppsigfetch/dbg/debug.go
Outdated
| DbgGetCurFile | ||
| DbgMacro | ||
| DbgFileType | ||
| DbgFlagAll = DbgParse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
相同的问题需要处理~ #245 (comment)
375284d to
333ba03
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #245 +/- ##
==========================================
- Coverage 78.84% 77.52% -1.32%
==========================================
Files 31 31
Lines 2940 2959 +19
==========================================
- Hits 2318 2294 -24
- Misses 604 630 +26
- Partials 18 35 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|


No description provided.