hsiaosiyuan0 commented on issue #145: Intercept cannot filter elapse time. URL: https://github.com/apache/dubbo-js/issues/145#issuecomment-551857255 @AtarisMio > Sometime the stdout of jexpose is panic. 没有明白,可以麻烦具体说一下为什么 jexpose 的 stdout 会 panic 吗? 我回忆到之前有一个 PR 往 jexpose 提交,也是去掉 elapsed time,当我回复了为什么要去掉的时候,作者就关了 PR, 估计是我的回复让他感觉我不会合并他的代码了 - - 我感觉和 @AtarisMio 说的差不多。这个 elapsed time 说是 feature 也略牵强,但是通过移除这个输出也是没有解决问题的根本。问题的根本是目前 jexpose 和 下游的 translator 之间的信息传递方式是不恰当的。jexpose 应该提供一个参数让下游指定输出的位置,然后 jexpose 把目前输出到 stdout 的内容结构化地输出到该位置。比如,下游指定输出到 `/tmp/some-random-path.json`,然后 `/tmp/some-random-path.json` 的内容为: ```json { "code": 0, "data": {}, "message": "" } ``` 这样下游才能准确地得到执行的结果。 我们接下来的计划是把用 jexpose 实现的部分用 ts 重写,合并到这个项目中,这样以后不会要分别维护两个不同的 codebase 而且是不同的语言实现。 当然现阶段的问题也是需要解决的,所以如果目前没有好的方案,而 @sunchuanleihit 的建议改动又最小的话,我觉得也不失为一个解决方案。因为接下来计划对 jexpose 和 translator 进行重构,所以比较大的修改希望可以尽可能的先避免。
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
