Facepunch / garrysmod-requests

Feature requests for Garry's Mod
84 stars 24 forks source link

Make "log" output exact console output #287

Open Cyberuben opened 10 years ago

Cyberuben commented 10 years ago

Currently there are several ways to log what happens on the server. The "-condebug" parameter creates a file called "console.log" and contains the exact console output including any errors. This is all in plain text and does not have color.

Some people use "log 1" to log their servers, however, this is not an exact console log, while some people might want to achieve that result. I'm currently trying to create a remote console viewer (so not sending commands, only receiving the console's output) and the difference in output (real console, and the received UDP packets) is quite big. example To add up to that, currently Lua errors are not captured by "log 1".

I'd like to request a change where "log 1" actually creates a 1-1 copy of the console, just like -condebug does. In that case, UDP packets would contain the exact information that is shown in the console and it would be completely possible to create a remote console viewer. Since packets are sent, I'd also like to ask for a feature where the color of the line is sent in the first 3-4 bytes, so that the output does not have to be parsed to look like the actual console.

jackwilsdon commented 10 years ago

I believe that Lua errors are logged to file using log 1, but I can't confirm whether they are networked with logaddress_add (they should be).

I can show that log 1 logs Lua errors to file by using cat *.log | grep "Lua Error" | wc -l inside my logs directory, which shows I have had 33 Lua errors.

I'm not sure if the team are able to modify the logging, as I don't know whether they have access to it's source.