• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: Logging

 
Chris Harris
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all,
In Max's book he uses the new Logging to enable some debugging. Is logging a hidden requirement?
Thanks Chris
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it's not required. It's mostly for your own benefit while developing. However it's not a bad practice in general, especially when you catch an unexplained error. E.g. if I catch a RemoteException, I can't really give a good explanation to the user other than "There's a problem with the network connection" and maybe show e.toString(). I don't want to show the user a stack trace; that will just scare them. But I would like the stack trace to be stored somewhere, to facilitate debugging later, and logging the exception to a file is a good way to do this. Or you could jsut print to console, that's probably OK. Non-techie users won't be looking at the console anyway, just the GUI, and console output can be redirected elsewhere easily enough.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic