Console output for debugging

Posted:
21 Apr 2010, 17:18
by slapshot5
Hi all,
Trying to use the console in Eclipse for debugging is almost useless right now due to the excessive writing of stuff like this:
- Code: Select all
Currently 16 images in the cache
New Image for key: mana_pool
File not found, no image created: res\pics\mana_pool.jpg
It looks like this is all (at least most) coming from ImageCache.java. Probably from when the cache was first being implemented.
I'd like to comment this stuff out and check it in to make the console useful for debugging. (Or if someone wants to set up some kind of debug context around stuff like this to only display when running in that context.)
Objections?
-slapshot5
Re: Console output for debugging

Posted:
21 Apr 2010, 18:05
by slapshot5
On the same topic, what about all this stuff?
- Code: Select all
java.lang.Exception: TreeProperties returns null for Display--properties
java.lang.Exception: TreeProperties returns null for Display/concede--properties
java.lang.Exception: TreeProperties returns null for Display/concede/button
java.lang.Exception: TreeProperties returns null for Display--properties
java.lang.Exception: TreeProperties returns null for en/Display--properties
java.lang.Exception: TreeProperties returns null for Display--properties
java.lang.Exception: TreeProperties returns null for en/Display--properties
I'm guessing this is something we need to fix?
-slapshot5
Re: Console output for debugging

Posted:
21 Apr 2010, 18:33
by DennisBergkamp
Yeah, feel free to comment out the caching stuff.
The treeproperties exceptions are minor, Silly Freak is still working on finishing those I think, let's keep those warnings in for now.
Re: Console output for debugging

Posted:
21 Apr 2010, 19:34
by Chris H.
slapshot5 wrote:I'd like to comment this stuff out and check it in to make the console useful for debugging. (Or if someone wants to set up some kind of debug context around stuff like this to only display when running in that context.)
Objections?
`
These debugging messages can sometimes stick around when then are no longer useful. Human tendency I guess.
We also tend to comment out code when we convert cards from code objects to keywords. The commented out code can also stick around for a longer period of time than is necessary.
Re: Console output for debugging

Posted:
21 Apr 2010, 20:38
by silly freak
I haven't thought too much about those TreeProperties outputs lately, but after looking a the code again, I resolved it. My property lookup code works recursive, and if a recursive call returns null, this is also printed
generally for debugging output, I'm using log4j for my program, and it works perfect for me. log4j lets you configure for which classes to print debug output, without changing the source code.