Logging everything

Is it a good idea to log everything(node, control, state etc etc attachment/detachment) in a log file? upto the point of when game ends or exception?

Heh, well if you make your log meaningful then you might have an easier time debugging things but be aware that log files quickly become very large and you have to account for the overhead in writing the file as well. @pspeed tends to do excessive logging which even made OSX suppress “more than 500 messages/second” :wink: but usually he knows vey quickly whats the issue when he gets a log. For most stuff I guess you can keep it down to severe problems and new or problematic code etc.

@normen said:
Heh, well if you make your log meaningful then you might have an easier time debugging things but be aware that log files quickly become very large and you have to account for the overhead in writing the file as well. @pspeed tends to do excessive logging which even made OSX suppress "more than 500 messages/second" ;) but usually he knows vey quickly whats the issue when he gets a log. For most stuff I guess you can keep it down to severe problems and new or problematic code etc.


And to be fair, I cut that output down to about 10% (at least) months and months ago. :)
1 Like

@pspeed so should I just stick to the exception like you do in Mythruna?

I personally would go the “log as much as you should” during development time then trim a lot when things are more stable.

@madjack The main overhead I am worried about is the logging volume. Is this something I should be worried about?

Do real logging (with Java logging or whatever) and then control it with a config file so you can turn it on or off as needed. During development, leave it relatively high and then turn it down or off later.



Mythruna logs to client.log and to error.log… the latter only on exception. client.log gets more logging and it still dumps some stuff to console. Which was generally only for me because you never see that on Windows but on Mac’s it eats through some system resources, apparently.

1 Like

Huge logging will bring FPS down some, that’s a given. Not by a huge margin, but it could go 10% of more depending on the complexity of the scene, models, etc, etc. HD space could be an issue too.



What you could try is to log to console and once you’ve gone through an iteration or whatever, copy the whole thing in a file as see how that weighs. Logging to console and to file is similar, but to file might be a bit slower and could hitch the game when saving.



It also depends if you want to log as-it-happens or only during/after crash.

Thanks. I’ll post back if I face trouble. :slight_smile: