use Logging Module EVERYWHERE, fix some MarvMan bugs

This commit is contained in:
Jonathan Jenne
2020-03-04 12:24:43 +01:00
parent 13b36db5fb
commit c8c650922b
22 changed files with 1279 additions and 1178 deletions

View File

@@ -16,7 +16,7 @@ Public Class ClassPostprocessing
Select Case oType
Case VBSPLIT
If LogErrorsOnly = False Then ClassLogger.Add(" ...Nachbearbeitung mit VBSPLIT", False)
LOGGER.Info(" ...Nachbearbeitung mit VBSPLIT")
Dim oSeparator As String = oDataRow.Item("TEXT1")
Dim oSplitIndex As Integer = 0
@@ -31,15 +31,15 @@ Public Class ClassPostprocessing
Dim oFindString = oDataRow.Item("TEXT1")
Dim oReplaceString = oDataRow.Item("TEXT2")
If LogErrorsOnly = False Then ClassLogger.Add(" ...Nachbearbeitung mit VBREPLACE", False)
If LogErrorsOnly = False Then ClassLogger.Add(" ...Ersetze '" & oFindString & "' mit '" & oReplaceString & "'", False)
LOGGER.Info(" ...Nachbearbeitung mit VBREPLACE")
LOGGER.Info(" ...Ersetze '" & oFindString & "' mit '" & oReplaceString & "'")
For Each oIndexValue In oIndexValues
Dim oReplaceResult = oIndexValue.Replace(oFindString, oReplaceString)
oResult.Add(oReplaceResult)
Next
Case REGEXPRESSION
If LogErrorsOnly = False Then ClassLogger.Add(" ...Nachbearbeitung mit RegEx", False)
LOGGER.Info(" ...Nachbearbeitung mit RegEx")
Dim oRegexList As New List(Of Regex)
Dim oRegex As New Regex(oDataRow.Item("TEXT1"), RegexOptions.IgnoreCase)
@@ -50,7 +50,7 @@ Public Class ClassPostprocessing
Dim oProcessedString = extractFromStringviaRE(oIndexValue, oRegexList)
oResult.Add(oProcessedString)
If LogErrorsOnly = False Then ClassLogger.Add(" ...Ergebnis des RegEx: " & oProcessedString, False)
LOGGER.Info(" ...Ergebnis des RegEx: " & oProcessedString)
Next
End Select
@@ -58,7 +58,7 @@ Public Class ClassPostprocessing
Next
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Get_Nachbearbeitung_Wert:")
ClassLogger.Add(" - Unvorhergesehener Unexpected error in Get_Nachbearbeitung_Wert - result: " & idxvalue & " - Fehler: " & vbNewLine & ex.Message)
LOGGER.Info(" - Unvorhergesehener Unexpected error in Get_Nachbearbeitung_Wert - result: " & idxvalue & " - Fehler: " & vbNewLine & ex.Message)
End Try
Return String.Join(ClassConstants.VECTORSEPARATOR, oIndexValues.ToArray)
@@ -68,41 +68,41 @@ Public Class ClassPostprocessing
' For Each row As DataRow In Datatable.Rows
' Select Case row.Item("TYPE").ToString.ToUpper
' Case "VBSPLIT"
' If LogErrorsOnly = False Then ClassLogger.Add(" ...Nachbearbeitung mit VBSPLIT", False)
' LOGGER.Info(" ...Nachbearbeitung mit VBSPLIT")
' Dim strSplit() As String
' strSplit = result.Split(row.Item("TEXT1"))
' For i As Integer = 0 To strSplit.Length - 1
' If i = CInt(row.Item("TEXT2")) Then
' If LogErrorsOnly = False Then ClassLogger.Add(" ...Split-Ergebnis für Index (" & i.ToString & "): " & strSplit(i), False)
' LOGGER.Info(" ...Split-Ergebnis für Index (" & i.ToString & "): " & strSplit(i))
' result = strSplit(i).ToString
' End If
' Next
' Case "VBREPLACE"
' If LogErrorsOnly = False Then
' ClassLogger.Add(" ...Nachbearbeitung mit VBREPLACE", False)
' ClassLogger.Add(" ...Ersetze '" & row.Item("TEXT1") & "' mit '" & row.Item("TEXT2") & "'", False)
' LOGGER.Info(" ...Nachbearbeitung mit VBREPLACE")
' LOGGER.Info(" ...Ersetze '" & row.Item("TEXT1") & "' mit '" & row.Item("TEXT2") & "'")
' result = result.Replace(row.Item("TEXT1"), row.Item("TEXT2"))
' End If
' result = result.Replace(row.Item("TEXT1"), row.Item("TEXT2"))
' Case "REG. EXPRESSION"
' If LogErrorsOnly = False Then ClassLogger.Add(" ...Nachbearbeitung mit RegEx", False)
' LOGGER.Info(" ...Nachbearbeitung mit RegEx")
' Dim RegexList As New List(Of System.Text.RegularExpressions.Regex)
' Dim Regex As New System.Text.RegularExpressions.Regex(row.Item("TEXT1"), System.Text.RegularExpressions.RegexOptions.IgnoreCase)
' RegexList.Add(Regex)
' '
' Dim resultRegex = ClassPostprocessing.extractFromStringviaRE(result, RegexList)
' If Not IsNothing(resultRegex) Then
' If LogErrorsOnly = False Then ClassLogger.Add(" ...Ergebnis des RegEx: " & resultRegex.ToString, False)
' LOGGER.Info(" ...Ergebnis des RegEx: " & resultRegex.ToString)
' result = resultRegex.ToString
' Else
' ClassLogger.Add("Postprocessing RegEx konnte kein Ergebnis auswerten!", True)
' LOGGER.Info("Postprocessing RegEx konnte kein Ergebnis auswerten!")
' End If
' End Select
' Next
' Return result
'Catch ex As Exception
' ClassLogger.Add(" - Unvorhergesehener Unexpected error in Get_Nachbearbeitung_Wert - result: " & result & " - Fehler: " & vbNewLine & ex.Message)
' LOGGER.Info(" - Unvorhergesehener Unexpected error in Get_Nachbearbeitung_Wert - result: " & result & " - Fehler: " & vbNewLine & ex.Message)
' MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Get_Nachbearbeitung_Wert:")
' Return result
'End Try