Some lines in my log are truncated.
I replaced my existing logging system with spdlog, but when I checked the logs, some of them were truncated. They only output the ending part.
My project used Qt, and this is the part where I initialize spdlog.
Here are some screenshots of the abnormal logs.
Do you have any ideas on how to solve this kind of problem?
Looking forward to your reply. (・̀ᴗ・́)و ̑̑
I don't think it is truncated in spdlog.
Check to see if the console you are using has a specification for splitting (chunking) excessively long line data.
For example, cmd.exe (on windows) has a limit of 8192 characters length: https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation
I don't think it is truncated in spdlog. Check to see if the console you are using has a specification for splitting (chunking) excessively long line data. For example,
cmd.exe(on windows) has a limit of 8192 characters length: https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation
Thank you for your reply, but the same content can be printed normally in subsequent logs. I have checked the byte count of this line, and it should not exceed 1,000.
Another phenomenon is that what it missed is the first half of this sentence.
What console is causing the problem? And does the same problem reproduce on another console?
I only use cmd in the Windows system.
I have just solved my problem. The reason is that using the static before InitConsole is not allowed, which would cause different InitConsole functions to be created and called in multithreading.
Use the static.
After removing the static.
Thank you very much! (≧∇≦)ノ