8000 Use Logger instead of println · armdev/java-design-patterns@a221245 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit a221245

Browse files
committed
Use Logger instead of println
1 parent 8bf4497 commit a221245

File tree

1 file changed

+11
-6
lines changed
  • cqrs/src/main/java/com/iluwatar/cqrs/app

1 file changed

+11
-6
lines changed

cqrs/src/main/java/com/iluwatar/cqrs/app/App.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
import java.math.BigInteger;
2626
import java.util.List;
2727

28+
import org.slf4j.Logger;
29+
import org.slf4j.LoggerFactory;
30+
2831
import com.iluwatar.cqrs.commandes.CommandServiceImpl;
2932
import com.iluwatar.cqrs.commandes.ICommandService;
3033
import com.iluwatar.cqrs.dto.Author;
@@ -39,6 +42,8 @@
3942
*
4043
*/
4144
public class App {
45+
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
46+
4247
/**
4348
* Program entry point
4449
*
@@ -71,12 +76,12 @@ public static void main(String[] args) {
7176
Book dddBook = queries.getBook("Domain-Driven Design");
7277
List<Book> jBlochBooks = queries.getAuthorBooks("jBloch");
7378

74-
System.out.println("Author username : " + nullAuthor);
75-
System.out.println("Author eEvans : " + eEvans);
76-
System.out.println("jBloch number of books : " + jBlochBooksCount);
77-
System.out.println("Number of authors : " + authorsCount);
78-
System.out.println("DDD book : " + dddBook);
79-
System.out.println("jBloch books : " + jBlochBooks);
79+
LOGGER.info("Author username : {}", nullAuthor);
80+
LOGGER.info("Author eEvans : {}", eEvans);
81+
LOGGER.info("jBloch number of books : {}", jBlochBooksCount);
82+
LOGGER.info("Number of authors : {}", authorsCount);
83+
LOGGER.info("DDD book : {}", dddBook);
84+
LOGGER.info("jBloch books : {}", jBlochBooks);
8085

8186
HibernateUtil.getSessionFactory().close();
8287
}

0 commit comments

Comments
 (0)
0