my dog learned polymorphism
The moose likes Beginning Java and the fly likes Logging problem and grammatical problems Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 659

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: 16695
    
  19

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: 659

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Logging problem and grammatical problems
 
Similar Threads
Blackjack program not good with random cards
Arraylist insights
Accessor methods on enum
cannot read a Collection of a custom class as a parameter
reading a private method within a class