-
When a file is specified as sink, it appears to be opened in binary mode: the letter spdlog/include/spdlog/details/file_helper-inl.h Lines 37 to 38 in 927cc29 As a consequence, a
The resulting text file ("my-log.txt") looks as follows:
Is it be possible to tweak spdlog to write a log file in text mode, so that on Windows, each |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
spdlog does not provide an option to change the file open mode. It should be possible to add something like an spdlog/include/spdlog/tweakme.h Lines 62 to 66 in 927cc29 spdlog/include/spdlog/details/os.h Lines 23 to 32 in 654dbc5 A workaround available in spdlog v1.11.0 is to create a custom formatter. It should be possible to implement this with reference to spdlog/include/spdlog/pattern_formatter-inl.h Lines 679 to 692 in 927cc29 |
Beta Was this translation helpful? Give feedback.
spdlog does not provide an option to change the file open mode.
You can open pull requests if you need such a feature.
It should be possible to add something like an
SPDLOG_EOL
macro that changes the newline character that spdlog adds to the end of a line.spdlog/include/spdlog/tweakme.h
Lines 62 to 66 in 927cc29
spdlog/include/spdlog/details/os.h
Lines 23 to 32 in 654dbc5