#502 Replaced usages of System.out with logger.
This commit is contained in:
		| @@ -22,6 +22,9 @@ | ||||
|  */ | ||||
| package com.iluwatar.proxy; | ||||
|  | ||||
| import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | ||||
|  | ||||
| /** | ||||
|  *  | ||||
|  * The object to be proxyed. | ||||
| @@ -29,8 +32,10 @@ package com.iluwatar.proxy; | ||||
|  */ | ||||
| public class WizardTower { | ||||
|  | ||||
|   private static final Logger LOGGER = LoggerFactory.getLogger(WizardTower.class); | ||||
|  | ||||
|   public void enter(Wizard wizard) { | ||||
|     System.out.println(wizard + " enters the tower."); | ||||
|     LOGGER.info("{} enters the tower.", wizard); | ||||
|   } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -22,6 +22,9 @@ | ||||
|  */ | ||||
| package com.iluwatar.proxy; | ||||
|  | ||||
| import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | ||||
|  | ||||
| /** | ||||
|  *  | ||||
|  * The proxy controlling access to the {@link WizardTower}. | ||||
| @@ -29,6 +32,8 @@ package com.iluwatar.proxy; | ||||
|  */ | ||||
| public class WizardTowerProxy extends WizardTower { | ||||
|  | ||||
|   private static final Logger LOGGER = LoggerFactory.getLogger(WizardTowerProxy.class); | ||||
|  | ||||
|   private static final int NUM_WIZARDS_ALLOWED = 3; | ||||
|  | ||||
|   private int numWizards; | ||||
| @@ -39,7 +44,7 @@ public class WizardTowerProxy extends WizardTower { | ||||
|       super.enter(wizard); | ||||
|       numWizards++; | ||||
|     } else { | ||||
|       System.out.println(wizard + " is not allowed to enter!"); | ||||
|       LOGGER.info("{} is not allowed to enter!", wizard); | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user