File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Logger and assertions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Logger and assertions" Watch "Logger and assertions" New topic

Logger and assertions

Jakub Drzazga
Ranch Hand

Joined: Nov 14, 2008
Posts: 41
Hello everybody

I would like to know, it is any sense to use logging (Logger class) or assertions in SCJD? I have just started write SCJD project, there is nothing in my assignment that I should use it but I read something about it in Andew Monkhouse�s book. Please help me.
Jethro Borsje
Ranch Hand

Joined: Jul 22, 2008
Posts: 100
I did not use assertions.

As to logging: I would really recommend using this. It helped my find a few nasty bugs, especially on the server side. Using logging greatly improves your feel on what the application is doing and it which order. I think this will also improve the life of the grader, because they might be able to use your log statements in order to assess what your application is doing.

Karen Smrha

Joined: Nov 13, 2008
Posts: 11
I also recommend logging, but be careful if you are writing to a file.

It could be that the person checking your project runs in a
directory without write permission. Your code should check
if it has write permission.

Good luck,
Karen Smrha

SCJD working on B&S
Roberto Perillo

Joined: Dec 28, 2007
Posts: 2271

I myself did not include any of those!
But that doesn't mean you guys can't do it...
[ November 19, 2008: Message edited by: Roberto Perillo ]

Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Jakub Drzazga
Ranch Hand

Joined: Nov 14, 2008
Posts: 41
Thank you
Jeffry Kristianto Yanuar
Ranch Hand

Joined: Oct 01, 2007
Posts: 759
I use logger instead System.out.println();
Using logger can make your method easier to debug.

Jeffry Kristianto Yanuar (Java Instructor)
SCJP 5.0, SCJA, SCJD (UrlyBird 1.3.2) --> Waiting for the result
Jethro Borsje
Ranch Hand

Joined: Jul 22, 2008
Posts: 100
And off course you can configure the logger way in a lot of different ways while you can not do that with System.out.
I agree. Here's the link:
subject: Logger and assertions
It's not a secret anymore!