Replies: 1 comment 1 reply
-
Hello, I understand the limitation of the RotatingFileHandler. It wouldn't be difficult to change it and let the user handle I haven't invested too much time into the See example example Having said that a solution to the first issue would be you write you own RotatingFileHandler class handling the rotation as you like. As I said the RotatingFileHandler can be changed in a future version. If you would like to give it a try right now, is creating your own handler classes enough as a workaround for both issues ? |
Beta Was this translation helpful? Give feedback.
-
I've just been having a brief look at quill, with the focus on whether it could replace spdlog in our code because there are a couple of things we want to be able to do that, to some extent, are more difficult than we'd hoped with spdlog.
The first thing is that, when using a rotating file handler (or "sink" in spdlog terms), we'd like to log a few lines of "header" info in. Until recently, doing that in spdlog was awkward as there was no indication of when the rotate occurred, and the rotating file sink was a final class, with a private "rotate" function, that meant just deriving and handling the rotate slightly differently wasn't possible. Spdlog's latest version adds support for callbacks that help this to be done. Unfortunately, though, quill (unless I'm missing something) seems to suffer from the same restriction; class rotating_file_handler is private and there are no indications that a rotate is about to happen :-(
The other thing would be to take the formatted text and encode/encrypt it before it gets written to a file. While it looks like it may be possible to work around this, somehow (possibly in the same way you need to with spdlog currently), it would be really nice to be able to configure everything 'normally' then, when you're sure it's all working, just be able to pass a callback in where the formatted log message was passed in, and an encoded version of it was returned which was then stored in the file, instead of the original formatted string.
Are either of these the sort of thing that could be considered for quill?
Beta Was this translation helpful? Give feedback.
All reactions