[BUG] server_log.txt has color codes and is not the complete log

Started by EK.IceFlake, Jan 16, 2017, 04:50 PM

Previous topic - Next topic

EK.IceFlake

Description
This image will explain

(as you can see, at the end, after the quotation mark, there is no text, however, the console should have it)

Reproducible
Always

What you were doing when the bug happened
Trying to show a console in the web browser by projecting server_log.txt

What you think caused the bug
Color codes: A print function that saves directly to log without removing some stuff
Incomplete log: No idea

jWeb

Because it uses buffered I/O. Meaning the log messages are only flushed to the file if the internal buffer is full. Otherwise it's written to the buffer and kept there until there's no more room. To force the log file to be synchronized you either have to flush the buffer after each message (could generate some intensive IO if too many servers do this simultaneously) or shut down the server (which if the one's that wrote the logging were smart enough, would force the buffer to be flushed before closing the file handle). The first one can't be achieved without the source and the second one is not desired. So the log file is not your option.

Your other choice is to redirect the console output to a file and use that to see what the server is logging. I believe `screen` can do this automatically IIRC.

KAKAN

Quote from: jWeb on Jan 16, 2017, 05:31 PMshut down the server (which if the one's that wrote the logging were smart enough, would force the buffer to be flushed before closing the file handle)
The last time I checked, this technique was not working. That log would still be...
oh no