#12295 Guard display of debug messages using keywords in Preferences

This commit is contained in:
Magne Sjaastad
2025-03-25 12:57:33 +01:00
parent 6b332269b4
commit 4b1e266539
4 changed files with 54 additions and 25 deletions
@@ -16,10 +16,11 @@
//
/////////////////////////////////////////////////////////////////////////////////
#include "RiaLogging.h"
#include "RigCellFaceGeometryTools.h"
#include "RiaLogging.h"
#include "RiaPreferencesSystem.h"
#include "RigActiveCellInfo.h"
#include "RigCell.h"
#include "RigMainGrid.h"
@@ -63,7 +64,7 @@ cvf::StructGridInterface::FaceType RigCellFaceGeometryTools::calculateCellFaceOv
isPossibleNeighborInDirection[cvf::StructGridInterface::POS_J] + isPossibleNeighborInDirection[cvf::StructGridInterface::NEG_J] +
isPossibleNeighborInDirection[cvf::StructGridInterface::POS_K] + isPossibleNeighborInDirection[cvf::StructGridInterface::NEG_K];
// If cell 2 is not adjancent with respect to any of the six ijk directions,
// If cell 2 is not adjacent with respect to any of the six ijk directions,
// assume that we have no overlapping area.
if ( !hasNeighbourInAnyDirection )
@@ -133,6 +134,8 @@ RigConnectionContainer RigCellFaceGeometryTools::computeOtherNncs( const RigMain
// by Eclipse. Use faults as basis for subset of cells to find NNC connection for. The imported connections from
// Eclipse are located at the beginning of the connections vector.
const bool isLoggingEnabled = RiaPreferencesSystem::current()->isLoggingActivatedForKeyword( "RigCellFaceGeometryTools" );
std::set<std::pair<unsigned, unsigned>> nativeCellPairs;
for ( size_t i = 0; i < nativeConnections.size(); ++i )
@@ -146,7 +149,7 @@ RigConnectionContainer RigCellFaceGeometryTools::computeOtherNncs( const RigMain
QString message = QString( "Nnc connection imported from Eclipse are not unique\nNNC count : %1\nUnique : %2" )
.arg( nativeConnections.size() )
.arg( nativeCellPairs.size() );
RiaLogging::warning( message );
if ( isLoggingEnabled ) RiaLogging::warning( message );
}
const cvf::Collection<RigFault>& faults = mainGrid->faults();
@@ -202,7 +205,7 @@ RigConnectionContainer RigCellFaceGeometryTools::computeOtherNncs( const RigMain
"inactive cells can be managed from Preferences->Eclipse Grid->Include Inactive Cells" )
.arg( otherConnections.size() )
.arg( nncCountWarningThreshold );
RiaLogging::warning( txt );
if ( isLoggingEnabled ) RiaLogging::warning( txt );
}
otherConnections.remove_duplicates();