Celestia
Celestia copied to clipboard
[1.7.0] Double backslashes in log
Describe the bug File paths in Celestia's log are displayed with double backslashes.
To Reproduce Steps to reproduce the behavior:
- Type
~
- See error
Expected behavior File paths should have single backslashes.
Screenshots
Desktop (please complete the following information):
- OS: Windows 10
- Frontend: Qt, Win
- Version: 1.7.0
Additional context Appears to be caused by #1139.
This matches the behaviour of the operator <<
from the C++17 filesystem library, which is specified to use std::quoted
and therefore renders the double backslash escape sequence.
In C++17, a potential fix to make the log output nicer would be to use the u8string()
method, unfortunately this is not forward-compatible with C++20 where this returns a std::u8string
(made up of char8_t
) instead of a std::string
(made up of char
) and therefore fails to compile. It would potentially be possible to use reinterpret_cast<const char*>(path_variable.u8string().c_str())
, although as far as I'm aware using the result of this as an actual pointer to const char
is undefined behaviour (but it probably works on all compilers).
Those .string()
/.u8string()
are really anoying.
On the latest build, file paths in Celestia's log aren't displayed when a texture is successfully loaded. It's just "Creating ordinary texture..."
If a texture isn't found, the path is still displayed (with single backslashes); if a model is loaded the path is still displayed (with double backslashes).
Verbosity of the message was raised from INFO to VERBOSE. There is still a lot to do to hided useless messages in default INFO mode.