#13126 RiaLogging: Use std::string_view instead of QString for logging

This commit is contained in:
Kristian Bendiksen committed 2026-05-08 10:11:09 +02:00
1 parent 4957bf5a8b
commit 5ffcb69acc
231 files changed
+1082 -893

No files matched your search

@@ -20,6 +20,7 @@
#include "RiaLogging.h"
#include "RiaPreferencesSystem.h"
#include "RiaQStringFormatter.h"
#include "RiaWeightedMeanCalculator.h"
#include "RigStatisticsTools.h"
#include "RiuMessageDialog.h"
@@ -113,7 +114,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
if ( !outputDir.mkpath( "." ) )
{
QString errMsg = QString( "Could not create export folder: %1" ).arg( exportSettings.folder );
RiaLogging::error( errMsg );
RiaLogging::error( errMsg.toStdString() );
return;
}
@@ -124,7 +125,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
if ( !fractureTransmissibilityExportInformationFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
{
RiaLogging::error(
QString( "Export Completions Data: Could not open the file: %1" ).arg( fractureTransmisibillityExportInformationPath ) );
std::format( "Export Completions Data: Could not open the file: {}", fractureTransmisibillityExportInformationPath ) );
}
else
{
@@ -173,7 +174,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v
int caseId = exportSettings.caseToApply->caseId();
QString format = QString( "Unit systems for well path \"%1\" must match unit system of chosen eclipse case \"%2\"" );
QString errMsg = format.arg( wellPath->name() ).arg( caseId );
RiaLogging::error( errMsg );
RiaLogging::error( errMsg.toStdString() );
}
std::map<size_t, std::vector<RigCompletionData>> completionsPerEclipseCellAllCompletionTypes;
@@ -447,7 +448,7 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
QString errorMessage = QString( "Invalid or negative transmissibility value (%1) in cell %3" )
.arg( transmissibility )
.arg( cellIndexIJK.oneBasedLocalCellIndexString() );
RiaLogging::error( errorMessage );
RiaLogging::error( errorMessage.toStdString() );
resultCompletion.addMetadata( "ERROR", errorMessage );
continue;
}
@@ -490,7 +491,7 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
{
QString errorMessage =
QString( "Cannot combine completions of different types in same cell %1" ).arg( cellIndexIJK.oneBasedLocalCellIndexString() );
RiaLogging::error( errorMessage );
RiaLogging::error( errorMessage.toStdString() );
resultCompletion.addMetadata( "ERROR", errorMessage );
return resultCompletion; // Returning empty completion, should not be exported
}
@@ -499,7 +500,7 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
{
QString errorMessage =
QString( "Transmissibility calculation has failed for cell %1" ).arg( cellIndexIJK.oneBasedLocalCellIndexString() );
RiaLogging::error( errorMessage );
RiaLogging::error( errorMessage.toStdString() );
resultCompletion.addMetadata( "ERROR", errorMessage );
return resultCompletion; // Returning empty completion, should not be exported
}
@@ -893,7 +894,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatAndWpimultTables(
}
}
RiaLogging::info( QString( "Successfully exported completion data to %1" ).arg( exportFile->fileName() ) );
RiaLogging::info( std::format( "Successfully exported completion data to {}", exportFile->fileName() ) );
}
//--------------------------------------------------------------------------------------------------