Merge pull request #14943 from GaetanoPiazzolla/JAVA-26071-fix-log

JAVA-26071 | log.info instead of system.out.println() + removed unuse…
This commit is contained in:
Kasra Madadipouya 2023-10-15 23:26:56 +02:00 committed by GitHub
commit 3361a7a123
4 changed files with 11 additions and 5 deletions

View File

@ -1,14 +1,16 @@
package com.baeldung.bridge; package com.baeldung.bridge;
import static com.baeldung.util.LoggerUtil.LOG;
public class BridgePatternDriver { public class BridgePatternDriver {
public static void main(String[] args) { public static void main(String[] args) {
//a square with red color //a square with red color
Shape square = new Square(new Red()); Shape square = new Square(new Red());
System.out.println(square.draw()); LOG.info(square.draw());
//a triangle with blue color //a triangle with blue color
Shape triangle = new Triangle(new Blue()); Shape triangle = new Triangle(new Blue());
System.out.println(triangle.draw()); LOG.info(triangle.draw());
} }
} }

View File

@ -1,5 +1,7 @@
package com.baeldung.composite; package com.baeldung.composite;
import static com.baeldung.util.LoggerUtil.LOG;
/** /**
* Created by Gebruiker on 5/1/2018. * Created by Gebruiker on 5/1/2018.
*/ */
@ -14,7 +16,7 @@ public class FinancialDepartment implements Department {
} }
public void printDepartmentName() { public void printDepartmentName() {
System.out.println(getClass().getSimpleName()); LOG.info(getClass().getSimpleName());
} }
public Integer getId() { public Integer getId() {

View File

@ -1,5 +1,7 @@
package com.baeldung.composite; package com.baeldung.composite;
import static com.baeldung.util.LoggerUtil.LOG;
/** /**
* Created by Gebruiker on 5/1/2018. * Created by Gebruiker on 5/1/2018.
*/ */
@ -14,7 +16,7 @@ public class SalesDepartment implements Department {
} }
public void printDepartmentName() { public void printDepartmentName() {
System.out.println(getClass().getSimpleName()); LOG.info(getClass().getSimpleName());
} }
public Integer getId() { public Integer getId() {

View File

@ -1,6 +1,6 @@
# Root logger # Root logger
log4j.rootLogger=INFO, file, stdout log4j.rootLogger=INFO, stdout
# Write to console # Write to console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender