-
Notifications
You must be signed in to change notification settings - Fork 19
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
Logs enforces Format #53
Comments
I think there are enough hooks in the library to make it thread-safe (see e.g. Regarding being slower than printf I suspect you won't see the difference in most use cases. If that is the case then I guess you can simply redefine a bunch of function that So so far I think that:
Is likely not worth the complexity. |
My main problem is that I have my own Log facility with an interface
And I use Format only because it is imposed by Logs which is itself imposed by caqti. I now duplicate the stdout formatter in that case and I think I am safe, but I would prefer not to think and I will probably do my own Db logging and not use at all the log feature proposed by caqti. For performance, with a medium log level on a website with simple_httpd, logging becomes non neglectable.
|
I find it odd that caqti imposes That being said I wouldn't mind adding something to Logs that allows per domain log files. Otherwise I tried your program on my machine an in terms of absolute numbers I get:
So that's a 243ms difference on 1 million requests. Let's say that's 250ms. This means the concrete loss per request for using Format instead of Printf is 250ns per request, I suspect this represents nothing w.r.t. to the latency of your network and/or database access. |
Logs seems to enforce the use of Format, while the polymorphic "format" types could allow to use Printf or a user defined function, for instance when you want to avoid mixing messages with concurrent system. The are two problems with Format:
Could give a functorial interface that would allow both Printf and Format ?
The text was updated successfully, but these errors were encountered: