Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Logging problem and grammatical problems  RSS feed

 
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


 
author
Posts: 23811
140
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!