Skip to content

Commit fd8421b

Browse files
committed
#12281 Well Target Mapping: Reduce logging.
1 parent 7b2e943 commit fd8421b

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.cpp

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "RiaLogging.h"
2222
#include "RiaPorosityModel.h"
23+
#include "RiaPreferencesSystem.h"
2324
#include "RiaResultNames.h"
2425
#include "RiaWeightedMeanCalculator.h"
2526

@@ -61,6 +62,8 @@ void RigWellTargetCandidatesGenerator::generateCandidates( RimEclipseCase*
6162
{
6263
if ( !eclipseCase->ensureReservoirCaseIsOpen() ) return;
6364

65+
bool isLoggingEnabled = RiaPreferencesSystem::current()->isLoggingActivatedForKeyword( "RigWellTargetMapping" );
66+
6467
auto activeCellCount = getActiveCellCount( eclipseCase );
6568
if ( !activeCellCount )
6669
{
@@ -140,11 +143,12 @@ void RigWellTargetCandidatesGenerator::generateCandidates( RimEclipseCase*
140143

141144
if ( startCell.has_value() )
142145
{
143-
RiaLogging::info( QString( "Cluster %1 start cell: [%2 %3 %4] " )
144-
.arg( clusterId )
145-
.arg( startCell->i() + 1 )
146-
.arg( startCell->j() + 1 )
147-
.arg( startCell->k() + 1 ) );
146+
if ( isLoggingEnabled )
147+
RiaLogging::info( QString( "Cluster %1 start cell: [%2 %3 %4] " )
148+
.arg( clusterId )
149+
.arg( startCell->i() + 1 )
150+
.arg( startCell->j() + 1 )
151+
.arg( startCell->k() + 1 ) );
148152

149153
growCluster( eclipseCase, startCell.value(), limits, data, filterVector, clusters, clusterId, timeStepIdx, maxIterations );
150154
numClustersFound++;
@@ -204,15 +208,18 @@ void RigWellTargetCandidatesGenerator::generateCandidates( RimEclipseCase*
204208
int clusterId = 1;
205209
for ( const auto& s : statistics )
206210
{
207-
RiaLogging::info( QString( "Cluster #%1 Statistics" ).arg( s.id ) );
208-
RiaLogging::info( QString( "Number of cells: %1" ).arg( s.numCells ) );
209-
RiaLogging::info( QString( "Total PORV*SOIL: %1" ).arg( s.totalPorvSoil ) );
210-
RiaLogging::info( QString( "Total PORV*SGAS: %1" ).arg( s.totalPorvSgas ) );
211-
RiaLogging::info( QString( "Total PORV*(SOIL+SGAS): %1" ).arg( s.totalPorvSoilAndSgas ) );
212-
RiaLogging::info( QString( "Total FIPOIL: %1" ).arg( s.totalFipOil ) );
213-
RiaLogging::info( QString( "Total FIPGAS: %1" ).arg( s.totalFipGas ) );
214-
RiaLogging::info( QString( "Average Permeability: %1" ).arg( s.permeability ) );
215-
RiaLogging::info( QString( "Average Pressure: %1" ).arg( s.pressure ) );
211+
if ( isLoggingEnabled )
212+
{
213+
RiaLogging::info( QString( "Cluster #%1 Statistics" ).arg( s.id ) );
214+
RiaLogging::info( QString( "Number of cells: %1" ).arg( s.numCells ) );
215+
RiaLogging::info( QString( "Total PORV*SOIL: %1" ).arg( s.totalPorvSoil ) );
216+
RiaLogging::info( QString( "Total PORV*SGAS: %1" ).arg( s.totalPorvSgas ) );
217+
RiaLogging::info( QString( "Total PORV*(SOIL+SGAS): %1" ).arg( s.totalPorvSoilAndSgas ) );
218+
RiaLogging::info( QString( "Total FIPOIL: %1" ).arg( s.totalFipOil ) );
219+
RiaLogging::info( QString( "Total FIPGAS: %1" ).arg( s.totalFipGas ) );
220+
RiaLogging::info( QString( "Average Permeability: %1" ).arg( s.permeability ) );
221+
RiaLogging::info( QString( "Average Pressure: %1" ).arg( s.pressure ) );
222+
}
216223

217224
addValuesForClusterId( totalPorvSoil, clusters, clusterId, s.totalPorvSoil );
218225
addValuesForClusterId( totalPorvSgas, clusters, clusterId, s.totalPorvSgas );

0 commit comments

Comments
 (0)