You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from 1.6.3 to 2.9.0, I'm no longer able to use "/dev/null" as a file name for quill::rotating_file_hander. This is useful for exercising quill and custom fmt types during tests without actually writing to disk.
The error is in quill/src/detail/misc/FileUtilities.cpp where std::filesystem::file_size throws an uncaught exception when RotatingFileHandler.cpp tries to set _current_size: size_t file_size(fs::path const& filename) { return static_cast<size_t>(fs::file_size(filename)); }
Here is the exception text: filesystem error: cannot get file size: Operation not supported [/dev/null]
The text was updated successfully, but these errors were encountered:
dirocco
changed the title
Quill unable to log to /dev/null
rotating_file_handler unable to log to /dev/null
May 26, 2023
hey, thanks for reporting this. I have added support to RotatingFileHandler and TimeRotatingFileHandler for /dev/null in latest master.
I have also added the NullHandler class.
Another way to skip logs completely is to never call quill::start() in your testing, that way the logs are only pushed to the unbounded queues but are never processed. But for more complete regression testing it's better to use /dev/null or the NullHandler as it will also process the log statements during your testing.
After upgrading from 1.6.3 to 2.9.0, I'm no longer able to use "/dev/null" as a file name for
quill::rotating_file_hander
. This is useful for exercising quill and custom fmt types during tests without actually writing to disk.The error is in
quill/src/detail/misc/FileUtilities.cpp
wherestd::filesystem::file_size
throws an uncaught exception whenRotatingFileHandler.cpp
tries to set_current_size
:size_t file_size(fs::path const& filename) { return static_cast<size_t>(fs::file_size(filename)); }
Here is the exception text:
filesystem error: cannot get file size: Operation not supported [/dev/null]
The text was updated successfully, but these errors were encountered: