improved debug logging with depth of decoration model

git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/trunk@1720626 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java b/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
index beb229f..3367364 100644
--- a/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
+++ b/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
@@ -402,7 +402,7 @@
 
         MavenProject parentProject = getParentProject( project, reactorProjects, localRepository );
 
-        DecorationModel decorationModel = getDecorationModel( siteDirectory, llocale, project, parentProject,
+        DecorationModel decorationModel = getDecorationModel( 0, siteDirectory, llocale, project, parentProject,
                                                               reactorProjects, localRepository, repositories, props );
 
         if ( decorationModel == null )
@@ -1025,6 +1025,7 @@
     }
 
     /**
+     * @param depth depth of project
      * @param siteDirectory, can be null if project.basedir is null, ie POM from repository
      * @param locale not null
      * @param project not null
@@ -1035,7 +1036,7 @@
      * @return the decoration model depending the locale
      * @throws SiteToolException if any
      */
-    private DecorationModel getDecorationModel( File siteDirectory, Locale locale, MavenProject project,
+    private DecorationModel getDecorationModel( int depth, File siteDirectory, Locale locale, MavenProject project,
                                                 MavenProject parentProject, List<MavenProject> reactorProjects,
                                                 ArtifactRepository localRepository,
                                                 List<ArtifactRepository> repositories, Map<String, String> origProps )
@@ -1099,7 +1100,8 @@
 
         if ( parentProject != null && ( decoration == null || decoration.isMergeParent() ) )
         {
-            getLogger().debug( "Looking for parent project site descriptor: " + parentProject.getId() );
+            depth++;
+            getLogger().debug( depth + "> Looking for parent project site descriptor: " + parentProject.getId() );
 
             MavenProject parentParentProject = getParentProject( parentProject, reactorProjects, localRepository );
 
@@ -1116,8 +1118,8 @@
             }
 
             DecorationModel parent =
-                getDecorationModel( parentSiteDirectory, locale, parentProject, parentParentProject, reactorProjects,
-                                    localRepository, repositories, props );
+                getDecorationModel( depth, parentSiteDirectory, locale, parentProject, parentParentProject,
+                                    reactorProjects, localRepository, repositories, props );
 
             // MSHARED-116 requires an empty decoration model (instead of a null one)
             // MSHARED-145 requires us to do this only if there is a parent to merge it with
@@ -1138,11 +1140,13 @@
             String parentDistMgmnt = getDistMgmntSiteUrl( parentProject );
             if ( getLogger().isDebugEnabled() )
             {
-                getLogger().debug( "assembling decoration model inheritance: distributionManagement.site.url child = " + projectDistMgmnt
-                    + " and parent = " + parentDistMgmnt );
+                getLogger().debug( "assembling decoration model inheritance: distributionManagement.site.url child = "
+                    + projectDistMgmnt + " and parent = " + parentDistMgmnt );
             }
             assembler.assembleModelInheritance( name, decoration, parent, projectDistMgmnt,
                                                 parentDistMgmnt == null ? projectDistMgmnt : parentDistMgmnt );
+
+            getLogger().debug( depth + "< decoration model ready for: " + parentProject.getId() );
         }
 
         return decoration;