From 2a5e8b9186d2a2a3755e132cbb066617fdd2fd72 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 17 Aug 2022 16:18:12 +0200 Subject: [PATCH] Interfaces: Improve logging in PropertyValues --- Modules.Interfaces/ZUGFeRDInterface/PropertyValues.vb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Modules.Interfaces/ZUGFeRDInterface/PropertyValues.vb b/Modules.Interfaces/ZUGFeRDInterface/PropertyValues.vb index b1ff0af4..110baacd 100644 --- a/Modules.Interfaces/ZUGFeRDInterface/PropertyValues.vb +++ b/Modules.Interfaces/ZUGFeRDInterface/PropertyValues.vb @@ -146,7 +146,7 @@ Public Class PropertyValues Try oPropertyValueList = GetPropValue(Document, oItem.Key) Catch ex As Exception - _logger.Warn($"{MessageId} # Unknown error occurred while fetching specification {0} in group {1}:", oTableColumn, oItem.Value.GroupScope) + _logger.Warn("{2} # Unknown error occurred while fetching specification [{0}] in group [{1}]:", oTableColumn, oItem.Value.GroupScope, MessageId) _logger.Error(ex) oPropertyValueList = New List(Of Object) End Try @@ -177,11 +177,11 @@ Public Class PropertyValues If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then If oItem.Value.IsRequired Then - _logger.Warn($"{MessageId} # Specification [{oTableColumn}] is empty, but marked as required! Skipping.") + _logger.Warn("{0} # Specification [{1}] is empty, but marked as required! Skipping.", MessageId, oTableColumn) oResult.MissingProperties.Add(oTableColumn) Continue For Else - _logger.Debug($"{MessageId} # oPropertyValue for specification [{oTableColumn}] is empty or not found. Skipping.") + _logger.Debug("{0} # oPropertyValue for specification [{1}] is empty or not found. Skipping.", MessageId, oTableColumn) Continue For End If @@ -208,7 +208,6 @@ Public Class PropertyValues Return New List(Of Object) End If - If oNameParts.Length = 1 Then Dim oPropInfo As PropertyInfo = Obj.GetType().GetProperty(PropertyName) @@ -235,7 +234,7 @@ Public Class PropertyValues Dim oInfo As PropertyInfo = oType.GetProperty(oPartName) If IsNothing(oInfo) OrElse IsNothing(oInfo.GetValue(Obj, Nothing)) Then - _logger.Debug("Property {0} does not exist(2).", oPartName) + _logger.Debug("Property [{0}] does not exist(2).", oPartName) Return New List(Of Object) End If