Closed jimmylomro closed 4 years ago
Just realised String time(std::ctime(&time_now)) will crash when ctime returns nullptr, creating a String and poping the last character will remove the trailing new-line character: char *time = std::ctime(&time_now); if (nullptr != time) { util::String time_str(time); time_str.pop_back(); ss << time_str << ":" << now_ms.count() % 1000 << " "; }
Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.
In the CreateLogPrefixLine: char *time = std::ctime(&time_now); if (nullptr != time) { ss << time << ":" << now_ms.count() % 1000 << " "; } time is a null terminated string and this character (null) also gets printed to ss creating a new line in the logs (only tried in osx and ubuntu). Probably a good idea wrapping it in a higher level string object would resolve this issue. String time(std::ctime(&time_now));