/**
 * The MIT License
 * Copyright (c) 2014-2016 Ilkka Seppälä
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.iluwatar.cqrs.app;

import java.math.BigInteger;
import java.util.List;

import com.iluwatar.cqrs.commandes.CommandServiceImpl;
import com.iluwatar.cqrs.commandes.ICommandService;
import com.iluwatar.cqrs.dto.Author;
import com.iluwatar.cqrs.dto.Book;
import com.iluwatar.cqrs.queries.IQueryService;
import com.iluwatar.cqrs.queries.QueryServiceImpl;
import com.iluwatar.cqrs.util.HibernateUtil;

/**
 * CQRS : Command Query Responsibility Segregation. A pattern used to separate query services from commands or writes
 * services.
 *
 */
public class App {
  /**
   * Program entry point
   * 
   * @param args
   *          command line args
   */
  public static void main(String[] args) {
    ICommandService commands = new CommandServiceImpl();

    // Create Authors and Books using CommandService
    commands.authorCreated("eEvans", "Eric Evans", "eEvans@email.com");
    commands.authorCreated("jBloch", "Joshua Bloch", "jBloch@email.com");
    commands.authorCreated("mFowler", "Martin Fowler", "mFowler@email.com");

    commands.bookAddedToAuthor("Domain-Driven Design", 60.08, "eEvans");
    commands.bookAddedToAuthor("Effective Java", 40.54, "jBloch");
    commands.bookAddedToAuthor("Java Puzzlers", 39.99, "jBloch");
    commands.bookAddedToAuthor("Java Concurrency in Practice", 29.40, "jBloch");
    commands.bookAddedToAuthor("Patterns of Enterprise Application Architecture", 54.01, "mFowler");
    commands.bookAddedToAuthor("Domain Specific Languages", 48.89, "mFowler");
    commands.authorNameUpdated("eEvans", "Eric J. Evans");

    IQueryService queries = new QueryServiceImpl();

    // Query the database using QueryService
    Author nullAuthor = queries.getAuthorByUsername("username");
    Author eEvans = queries.getAuthorByUsername("eEvans");
    BigInteger jBlochBooksCount = queries.getAuthorBooksCount("jBloch");
    BigInteger authorsCount = queries.getAuthorsCount();
    Book dddBook = queries.getBook("Domain-Driven Design");
    List<Book> jBlochBooks = queries.getAuthorBooks("jBloch");

    System.out.println("Author username : " + nullAuthor);
    System.out.println("Author eEvans : " + eEvans);
    System.out.println("jBloch number of books : " + jBlochBooksCount);
    System.out.println("Number of authors : " + authorsCount);
    System.out.println("DDD book : " + dddBook);
    System.out.println("jBloch books : " + jBlochBooks);

    HibernateUtil.getSessionFactory().close();
  }

}

@@ -1221,16 +1221,74 @@
 .List;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A
 import c
@@ -1764,16 +1764,92 @@
 s App %7B%0A
+  private static final Logger LOGGER = LoggerFactory.getLogger(App.class);%0A%0A
   /**%0A  
@@ -3317,34 +3317,27 @@
 );%0A%0A    
-System.out.println
+LOGGER.info
 (%22Author
@@ -3348,19 +3348,20 @@
 rname : 
-%22 +
+%7B%7D%22,
  nullAut
@@ -3370,34 +3370,27 @@
 r);%0A    
-System.out.println
+LOGGER.info
 (%22Author
@@ -3399,19 +3399,20 @@
 Evans : 
-%22 +
+%7B%7D%22,
  eEvans)
@@ -3417,34 +3417,27 @@
 s);%0A    
-System.out.println
+LOGGER.info
 (%22jBloch
@@ -3447,35 +3447,36 @@
 mber of books : 
-%22 +
+%7B%7D%22,
  jBlochBooksCoun
@@ -3483,34 +3483,27 @@
 t);%0A    
-System.out.println
+LOGGER.info
 (%22Number
@@ -3516,19 +3516,20 @@
 thors : 
-%22 +
+%7B%7D%22,
  authors
@@ -3540,34 +3540,27 @@
 t);%0A    
-System.out.println
+LOGGER.info
 (%22DDD bo
@@ -3564,19 +3564,20 @@
  book : 
-%22 +
+%7B%7D%22,
  dddBook
@@ -3587,26 +3587,19 @@
     
-System.out.println
+LOGGER.info
 (%22jB
@@ -3615,11 +3615,12 @@
 s : 
-%22 +
+%7B%7D%22,
  jBl

Use Logger instead of println