• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How much logging ?

 
Alan Mc Kernan
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm planning on leaving logging in my code so that it may be eaiser for the examiner.. and thus a better grade for me!

But im not sure how much logging to leave in.. Ideally i'd like to have te logs tell a story so to speak..

Below is the minimal amount i think necessary to tell the story.

When I log the unlock.. should i put the logging in before the unlock or after like i have below?

Theres a chance that another thread could slice in after the unlock and before my log statement gets printed thus could be misleading... what do you think?


Cheers
Alan


 
hatim osman
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Alan
My be this beyound the scope of your question, but your post has helped me in many ways. In fact, I have been confused about logging for quite a long time now (considering that this is my first time), and I really didn't know how to use it much although I have covered the API well I guess. I really would appreciate if you can sopt the light more on your logging technique. Like how are your creating your loggers, the levels your setting for the loggers and how are you setting them (file or programmatically).

thanx in advance
hatim
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alan,
Originally posted by Alan Mc Kernan:
I'm planning on leaving logging in my code so that it may be eaiser for the examiner.. and thus a better grade for me!

From the instructions:
You will not receive extra credit points for work beyond the requirements of the specification.
While I agree with leaving the logging in place, the instructions indicate that you will not get a better grade by doing so!

[For what it's worth, I subscribe to the idea that there is rarely a need to remove logging or unit tests: having found them useful at some point, they are likely to be useful in the future.]

Originally posted by Alan Mc Kernan:
Theres a chance that another thread could slice in after the unlock and before my log statement gets printed thus could be misleading... what do you think?
Since you are prefixing your log messages with the thread ID I don't think there is much chance of confusion.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic