Conversation
|
~~how about #2521 ~~ |
| pc, _, _, _ := runtime.Caller(2) | ||
| details := runtime.FuncForPC(pc).Name() | ||
| if len(details) >= trim { | ||
| details = details[trim:] |
There was a problem hiding this comment.
how about trimming the string until the first . too, so that (*Handler).Process disappears? then it is a pure refactor.
I am in favor of removing errors.generated.go, the file seemed annoying to copy for me.
Is there a runtime penalty for checking the stack like this?
There was a problem hiding this comment.
We could trim more, but I think method name could be helpful as well. Many logger specifically does that.
For runtime cost, old way use reflect too. Cost should be similar. In general I would prefer save people time vs cpu time
There was a problem hiding this comment.
In general I would prefer save people time
get rid of config.pb.go please thank you
There was a problem hiding this comment.
Are you taking about whole use of Protobuf?
There was a problem hiding this comment.
yeah. I suppose it's for the users API? biggest trouble in writing the first version of the transport was to install the right version of protobuf compiler
There was a problem hiding this comment.
that's learning time, not wasted
A lot of people hate Protobuf, it's controversy around the original author of v2ray.
My take is it is better for backend API dev with built-in types and compatibility and encode efficiency. I think it is an interesting choice here, has both good and bad.
BTW my next priority going to improve on xray APIs..
|
Planned for 1.9 |
|
Given the likelihood of merge conflict with other work, I will merge to main later if no further comments.. |
感觉在小版本改日志格式不太好, |
那(如之前讨论)我可以加个字符串截取 这样就是纯 refactor? |
* Refactor log * Add new log methods * Fix logger test * Change all logging code * Clean up pathObj * Rebase to latest main * Remove invoking method name after the dot
* Refactor log * Add new log methods * Fix logger test * Change all logging code * Clean up pathObj * Rebase to latest main * Remove invoking method name after the dot
This is just an example of the code. I'm trying to:
LogInfo(ctx context.Context, msg ...interface{})new log:
[1350929471] proxy/freedom.(*Handler).Process: connection opened to tcp:127.0.0.1:46565, local endpoint 127.0.0.1:41428, remote endpoint 127.0.0.1:46565old log:
[1350929471] proxy/freedom: connection opened to tcp:127.0.0.1:46565, local endpoint 127.0.0.1:41428, remote endpoint 127.0.0.1:46565