I have encountered some strange behavior which I can't explain.
I'm using boost log v1 to log to the console using wtext_ostream_backend
and to a file using wtext_file_backend
.
Everything usually work fine, but just the other day the application stopped printing to the console, though it continued to log to file. When I looked in the file for the line where the console stopped printing i noted something strange:
0: [02/07/12 13:49:38] [07437538] [info] Client 10.28.62.1 was disconnected
1: [02/07/12 13:49:40] [07437538] [info] Received message from 10.50.128.77: [02/07/12 13:49:40] [07437538] [info] Sent message to 10.50.128.77: 400 ERROR\r\n2[02/07/12 13:49:40] [07437538] [info] Received message from 10.28.48.9: VERSION\r\n
4: [02/07/12 13:49:40] [07437538] [info] Received message from 10.28.48.9: VERSION\r\n
3: [02/07/12 13:49:40] [00C79D10] [debug] Executed command: VersionCommand
If you look at line 1:
you can see that Received message from 10.50.118.77:
abruptly end and the next message is written without line breaks. Which otherwise never is the case.
The last thing the console printed was Received message from 10.50.118.77:
.
Any ideas what might cause this? Could it be some weird character that followed Received message from 10.50.118.77:
that messes everything up? How can avoid/tolerate such characters?
也许您没有正确地使用null char终止字符串。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.