You've already forked pgbackrest
							
							
				mirror of
				https://github.com/pgbackrest/pgbackrest.git
				synced 2025-10-30 23:37:45 +02:00 
			
		
		
		
	Reduce log verbosity in doc.pl.
Reduce verbosity by only logging sections that contain an execute list directly or in a child section.
This commit is contained in:
		| @@ -270,7 +270,7 @@ eval | ||||
|         elsif (($strOutput eq 'help' || $strOutput eq 'man') && $oManifest->isBackRest()) | ||||
|         { | ||||
|             # Generate the command-line help | ||||
|             my $oRender = new BackRestDoc::Common::DocRender('text', $oManifest); | ||||
|             my $oRender = new BackRestDoc::Common::DocRender('text', $oManifest, !$bNoExe); | ||||
|             my $oDocConfig = | ||||
|                 new BackRestDoc::Common::DocConfig( | ||||
|                     new BackRestDoc::Common::Doc("${strBasePath}/xml/reference.xml"), $oRender); | ||||
|   | ||||
| @@ -57,7 +57,7 @@ sub new | ||||
|         ); | ||||
|  | ||||
|     # Create the class hash | ||||
|     my $self = $class->SUPER::new($strType, $oManifest, $strRenderOutKey); | ||||
|     my $self = $class->SUPER::new($strType, $oManifest, $bExe, $strRenderOutKey); | ||||
|     bless $self, $class; | ||||
|  | ||||
|     if (defined($self->{oSource}{hyCache})) | ||||
|   | ||||
| @@ -156,6 +156,7 @@ sub new | ||||
|         my $strOperation, | ||||
|         $self->{strType}, | ||||
|         $self->{oManifest}, | ||||
|         $self->{bExe}, | ||||
|         $self->{strRenderOutKey}, | ||||
|     ) = | ||||
|         logDebugParam | ||||
| @@ -163,6 +164,7 @@ sub new | ||||
|             __PACKAGE__ . '->new', \@_, | ||||
|             {name => 'strType'}, | ||||
|             {name => 'oManifest'}, | ||||
|             {name => 'bExe'}, | ||||
|             {name => 'strRenderOutKey', required => false} | ||||
|         ); | ||||
|  | ||||
| @@ -432,6 +434,10 @@ sub build | ||||
|             $oNode->paramSet('depend-default', $strDependPrev); | ||||
|         } | ||||
|  | ||||
|         # Set log to true if this section has an execute list.  This helps reduce the info logging by only showing sections that are | ||||
|         # likely to take a log time. | ||||
|         $oNode->paramSet('log', $self->{bExe} && $oNode->nodeList('execute-list', false) > 0 ? true : false); | ||||
|  | ||||
|         # If section content is being pulled from elsewhere go get the content | ||||
|         if ($oNode->paramTest('source')) | ||||
|         { | ||||
| @@ -527,6 +533,12 @@ sub build | ||||
|         if (ref(\$oChild) ne "SCALAR") | ||||
|         { | ||||
|             $self->build($oChild, $oNode, $strPath, $strPathPrefix); | ||||
|  | ||||
|             # If the child should be logged then log the parent as well so the hierarchy is complete | ||||
|             if ($oChild->nameGet() eq 'section' && $oChild->paramGet('log')) | ||||
|             { | ||||
|                 $oNode->paramSet('log', true); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -219,7 +219,10 @@ sub sectionProcess | ||||
|             {name => 'iDepth'} | ||||
|         ); | ||||
|  | ||||
|     &log(INFO, ('    ' x ($iDepth + 1)) . 'process section: ' . $oSection->paramGet('path')); | ||||
|     if ($oSection->paramGet('log')) | ||||
|     { | ||||
|         &log(INFO, ('    ' x ($iDepth + 1)) . 'process section: ' . $oSection->paramGet('path')); | ||||
|     } | ||||
|  | ||||
|     if ($iDepth > 3) | ||||
|     { | ||||
|   | ||||
| @@ -110,7 +110,10 @@ sub sectionProcess | ||||
|             {name => 'iDepth'} | ||||
|         ); | ||||
|  | ||||
|     &log(INFO, ('    ' x ($iDepth + 1)) . 'process section: ' . $oSection->paramGet('path')); | ||||
|     if ($oSection->paramGet('log')) | ||||
|     { | ||||
|         &log(INFO, ('    ' x ($iDepth + 1)) . 'process section: ' . $oSection->paramGet('path')); | ||||
|     } | ||||
|  | ||||
|     # Create the section | ||||
|     my $strSectionTitle = $self->processText($oSection->nodeGet('title')->textGet()); | ||||
|   | ||||
| @@ -176,7 +176,10 @@ sub sectionProcess | ||||
|             {name => 'iDepth'} | ||||
|         ); | ||||
|  | ||||
|     &log(INFO, ('    ' x ($iDepth + 1)) . 'process section: ' . $oSection->paramGet('path')); | ||||
|     if ($oSection->paramGet('log')) | ||||
|     { | ||||
|         &log(INFO, ('    ' x ($iDepth + 1)) . 'process section: ' . $oSection->paramGet('path')); | ||||
|     } | ||||
|  | ||||
|     if ($iDepth > 3) | ||||
|     { | ||||
|   | ||||
| @@ -206,6 +206,10 @@ | ||||
|                 </release-feature-list> | ||||
|  | ||||
|                 <release-refactor-list> | ||||
|                     <release-item> | ||||
|                         <p>Reduce log verbosity when building documentation by only logging sections that contain an execute list directly or in a child section.</p> | ||||
|                     </release-item> | ||||
|  | ||||
|                     <release-item> | ||||
|                         <p>Debian/Ubuntu documentation now builds on Ubuntu 16.</p> | ||||
|                     </release-item> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user