It's not a secret anymore!*
The moose likes Beginning Java and the fly likes Logging problem and grammatical problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Logging problem and grammatical problems" Watch "Logging problem and grammatical problems" New topic
Author

Logging problem and grammatical problems

Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 660

I'm toying around with a Poker game, and, I have three problems...
1. Output from Apache log4j, is being returned multiple times rather than once. Also somehow I can't find a way of getting Eclipse 3.6.2 to read from log4j.properties.



2. I can't find a way to have the Player.toString() method loop through ArrayList Player.CardSheld, and, validate whether the counter variable has reached its size, so I was thinking in terms of...





Somehow I am suspecting that the above for loop is the reason for my Logger variable _log creating the first issue, however I can't figure out how, and, how to go about it.

Output


So far I have tested that all the deck of 52 cards has been distributed to the 5 players so that no player has the same card and that players get different cards, and, this is expected. The random shuffling is fine as well.

Log4j.properties




Jon
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18507
    
  40

Jon Camilleri wrote:
Somehow I am suspecting that the above for loop is the reason for my Logger variable _log creating the first issue, however I can't figure out how, and, how to go about it.


That's what the logger is for -- to give you visibility into your application. If you are suspecting something, confirm it by adding logging statements that will either prove or disprove your suspicions.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 660

Henry Wong wrote:
Jon Camilleri wrote:
Somehow I am suspecting that the above for loop is the reason for my Logger variable _log creating the first issue, however I can't figure out how, and, how to go about it.


That's what the logger is for -- to give you visibility into your application. If you are suspecting something, confirm it by adding logging statements that will either prove or disprove your suspicions.

Henry


It's basically to test Apache Log 4j and how I can use it while developing a program.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Logging problem and grammatical problems
 
Similar Threads
Blackjack program not good with random cards
Accessor methods on enum
Arraylist insights
cannot read a Collection of a custom class as a parameter
reading a private method within a class