-
Notifications
You must be signed in to change notification settings - Fork 43
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
Compatibility with rs/logbench #29
Comments
thanks for that, looking into. |
changed |
Currently I cannot found a simple/pretty way to disable time filed. But seems that https://github.com/rs/logbench could bypass this scenario case? |
Thanks for your swift response. As you can see in this line main_test.go#L356 and main_test.go#L435, currently the test expects no timestamp from all supported loggers. The easiest way I could think of to bypass this for phuslu/log is to add I hope that commit dcbf2d6 does not cause negative impact to the performance? |
thanks for indicated this, I will continue considering it. And the latest |
I don't think it's the same. In the test case below, main_test.go#L73 is passing Currently there is no way to set
I just added
EDIT: |
I tried fix Please take a look, thanks |
tried fix TimeFormat and Time again on 47c682d |
Also |
sorry, it's an over-optimized issue. I fallback to an normal implementation and also update |
Thanks for your hard work so far! Happy 🐮 year I have temporary enabled GitHub Pages on my logbench fork, you can view the benchmark results on the web UI here or the text format here. You can exclude some loggers by clicking on them like so Unfortunately, phuslu/log is not the fastest according to the benchmark results. I believe this is because other loggers have their timestamp disabled, while we are having timestamp included in the log. Also phuslu/log doesn't have results for |
Thank you!
True, maybe we need added a special field named like const TimeFieldDisabled = "\b" To let we also disable the timestampl |
Indeed i sent a pr at imkira/go-loggers-bench#6 before I very agree that |
My primary intention of adding this logger into logbench is to get a more in-depth insight of the performance benchmark. This is because the GitHub Actions is very limited, i.e. it doesn't benchmark fields other than I am considering to use this logger in one of my production project as it is dependency free (I love minimal dependencies 🤣) and the performance seems promising. At the same time, this logger lacks a little bit in customisation. If there is a way to provide more options to customise the logger behaviour, while not harming the performance and making the code less readable, then I will definitely choose this logger over another. |
Tried to hide the time filed but the code changes are ugly and trivial. This lib already be widely used in our internal company, serves 5 billion requests and writes same amount logs per day.
is the most important motivation of this lib. During the implementation progress, we found that time filed usual is a must have thing. And its formatting is the most visible cost of log entry. That's why we introduce a handwriting formatting function for it. So as your see, time field of this is first field and hard to be omitted. |
Yes, I agree with you completely. There is no reason to omit the time field as that would make debugging harder, especially in a production environment. I was confused by the logbench benchmark measurements initially as well. Then I realised that the whole benchmark is more focusing on single field performance, e.g. how efficient does it take to log a single I believe this is a good logger library, maybe we can add more benchmark into the GitHub Actions rather than relying on imkira/go-loggers-bench or rs/logbench. I'm closing this issue now since there is no point in forcing this library to be compatible with logbench. Peace out ✌️ |
thanks for your support. I align to go-logger-bench codes in latest readme, and the github action result is here https://github.com/phuslu/log/runs/1910179311 I think the result makes convincing. |
Added two common(I think) cases to benchmarks, The result shows this lib‘s competitiveness
|
I like this logger a lot because it has zero dependencies and an intuitive API. Therefore, I hope that it can gain more popularity among the Go community.
I have created a draft pull request rs/logbench#4 in the rs/logbench repository to include this logger. However, this logger currently does not pass the validation of logbench, more details can be found in rs/logbench#4.
To pass the logbench validation, this logger must
Time
andDuration
The text was updated successfully, but these errors were encountered: