MS V2.7 .Net Logger etc

This commit is contained in:
2021-06-15 16:28:55 +02:00
parent e2619eb3ad
commit e796ae91cb
109 changed files with 295499 additions and 8793 deletions

View File

@@ -26,7 +26,7 @@ Public Class frmWM_IndexFile
stopwatch.Stop()
Dim message = String.Format("{0, 5}ms || {1}", stopwatch.ElapsedMilliseconds, label)
Console.WriteLine(message)
If LogErrorsOnly = False Then ClassLogger.Add(message, False)
LOGGER.Debug(message, False)
Return stopwatch.ElapsedMilliseconds
End Function
@@ -115,7 +115,7 @@ Public Class frmWM_IndexFile
Dim indexname
''den Record_Key auslesen
'Dim indexname = DT.Rows(0).Item("IDXNAME_RECORDID").ToString
'If LogErrorsOnly = False Then ClassLogger.Add(" >> Record-ID: " & CURRENT_RECORD_ID.ToString, False)
'LOGGER.Debug("Record-ID: " & CURRENT_RECORD_ID.ToString, False)
'indexierung_erfolgreich = clsWD_SET.IndexFile(CURRENT_FILEIN_WD, indexname, CURRENT_RECORD_ID, clsWindream.MY_WDOBJECTTYPE)
'If indexierung_erfolgreich = False Then
' err = True
@@ -125,7 +125,7 @@ Public Class frmWM_IndexFile
'End If
'den Entity-Key auslesen
'indexname = DT.Rows(0).Item("IDXNAME_ENTITYID").ToString
'If LogErrorsOnly = False Then ClassLogger.Add(" >> Entity-ID: " & CURRENT_ENTITY_ID.ToString, False)
'LOGGER.Debug("Entity-ID: " & CURRENT_ENTITY_ID.ToString, False)
'indexierung_erfolgreich = clsWD_SET.IndexFile(CURRENT_FILEIN_WD, indexname, CURRENT_ENTITY_ID, clsWindream.MY_WDOBJECTTYPE)
'If indexierung_erfolgreich = False Then
' err = True
@@ -138,7 +138,7 @@ Public Class frmWM_IndexFile
'End If
'den Doctype auslesen
indexname = DTTBPMO_WD_OBJECTTYPE.Rows(0).Item("IDXNAME_DOCTYPE").ToString
If LogErrorsOnly = False Then ClassLogger.Add(" >> Doctype: " & vDokart.ToString, False)
LOGGER.Debug("Doctype: " & vDokart.ToString, False)
indexierung_erfolgreich = clsWD_SET.IndexFile(CURRENT_FILEIN_WD, indexname, vDokart, clsWindream.MY_WDOBJECTTYPE)
If indexierung_erfolgreich = False Then
err = True
@@ -185,27 +185,27 @@ Public Class frmWM_IndexFile
' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
For Each element As System.Text.RegularExpressions.Match In elemente
If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False)
LOGGER.Debug("element in RegeX: " & element.Value, False)
Select Case element.Value.Substring(2, 1).ToUpper
'Nur automatische Indizes auswerten
Case "A"
Dim APattern = element.Value.Substring(3, element.Value.Length - 4)
If APattern.Contains("#") Then
If LogErrorsOnly = False Then ClassLogger.Add(" >> element filled with Record-Data.......: ", False)
LOGGER.Debug("element filled with Record-Data.......: ", False)
Dim split() As String = APattern.Split("#")
If split.Length = 2 Then
Dim CONTROL_ID = split(1)
If LogErrorsOnly = False Then ClassLogger.Add(" >> CONTROL_ID: " & CONTROL_ID, False)
LOGGER.Debug("CONTROL_ID: " & CONTROL_ID, False)
If IsNumeric(CONTROL_ID) Then
Dim CONTROLVALUE = ClassControlValues.Get_Control_Value_for_ID(CONTROL_ID, CURRENT_RECORD_ID)
If IsNothing(CONTROLVALUE) Then
ClassLogger.Add(">> Index should be filled with value of Control-ID '" & CONTROL_ID & "', but result was nothing.", False)
ClassLogger.Add(">> SQL-Command: " & CURRENT_LAST_SQL)
LOGGER.Warn("Index should be filled with value of Control-ID '" & CONTROL_ID & "', but result was nothing.", False)
LOGGER.Warn("SQL-Command: " & CURRENT_LAST_SQL)
idxvalue = ""
Else
If IsDBNull(CONTROLVALUE) Then
ClassLogger.Add(">> Index should be filled with value of Control-ID '" & CONTROL_ID & "', but result was DBNULL.", False)
ClassLogger.Add(">> SQL-Command: " & CURRENT_LAST_SQL)
LOGGER.Warn("Index should be filled with value of Control-ID '" & CONTROL_ID & "', but result was DBNULL.", False)
LOGGER.Warn("SQL-Command: " & CURRENT_LAST_SQL)
idxvalue = ""
Else
idxvalue = CONTROLVALUE
@@ -220,7 +220,7 @@ Public Class frmWM_IndexFile
Next
End If
If LogErrorsOnly = False Then ClassLogger.Add(" >> Value for Indexing : '" & idxvalue.ToString & "'", False)
LOGGER.Debug("Value for Indexing : '" & idxvalue.ToString & "'", False)
Count += 1
indexierung_erfolgreich = clsWD_SET.IndexFile(CURRENT_FILEIN_WD, indexname, idxvalue, clsWindream.MY_WDOBJECTTYPE)
If indexierung_erfolgreich = False Then
@@ -248,7 +248,7 @@ Public Class frmWM_IndexFile
'Nun alles aufrüumen und die neue DocID holen
If indexierung_erfolgreich = True Then
ClassLogger.Add(">> File was correctly imported and indexed: " & CURRENT_FILEIN_WD, False)
LOGGER.Info("File was correctly imported and indexed: " & CURRENT_FILEIN_WD, False)
Dim stg As String = "Datei erfolgreich nach windream übertragen"
Dim stg1 As String = "Erfolgsmeldung"
If USER_LANGUAGE <> "de-DE" Then
@@ -275,7 +275,7 @@ Public Class frmWM_IndexFile
If Not IsNothing(CURRENT_DOC_ID) Then
ClassHelper.InsertEssential_Log(CURRENT_DOC_ID, "DOC_ID", "File was imported and indexed!")
ClassLogger.Add(String.Format(">> File-Import was finished - DocID: {0} ", CURRENT_DOC_ID), False)
LOGGER.Info(String.Format("File-Import was finished - DocID: {0} ", CURRENT_DOC_ID), False)
Dim delete = False
'Die Originaldatei löschen
If droptype = "dragdrop file" And indexierung_erfolgreich = True Then
@@ -332,7 +332,7 @@ Public Class frmWM_IndexFile
stg = "Unexpected Error: Could not get a docId for transmitted file!"
End If
ClassLogger.Add(stg, True)
LOGGER.Warn(stg)
MsgBox(stg, MsgBoxStyle.Critical, stg1)
End If
Else
@@ -362,7 +362,7 @@ Public Class frmWM_IndexFile
' ' MsgBox(DT.Rows.Count.ToString)
' For Each DR_AUTOINDEX As DataRow In DD_DMSDataSet.VWDDINDEX_AUTOM.Rows
' Dim indexname As String = DR_AUTOINDEX.Item("INDEXNAME")
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Build Automatischer Index '" & indexname & "'", False)
' LOGGER.Debug("Build Automatischer Index '" & indexname & "'", False)
' If DR_AUTOINDEX.Item("SQL_RESULT").ToString <> String.Empty And CBool(DR_AUTOINDEX.Item("SQL_ACTIVE")) = True Then
' ' Regulären Ausdruck zum Auslesen der windream-Indexe definieren
' Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
@@ -375,32 +375,32 @@ Public Class frmWM_IndexFile
' ' alle Vorkommen der Indexe im SQL-String durchlaufen
' For Each element As System.Text.RegularExpressions.Match In elemente
' ' MsgBox(element.Value.ToUpper)
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Element: '" & element.Value & "'", False)
' LOGGER.Debug("Element: '" & element.Value & "'", False)
' '' wenn es sich nicht um dedizeirte Werte handelt (es sollen ja nur die Indexe ausgelesen werden)
' 'If Not element.Value.ToUpper = "[%SPALTE]" And Not element.Value.ToUpper = "[%VIEW]" Then
' 'die Zeichen [% und ] entfernen (liefert den wirklichen windream-Index)
' Dim elementOhneSonderzeichen As String = element.Value.Substring(2, element.Value.Length - 3)
' If LogErrorsOnly = False Then ClassLogger.Add(" >> elementOhneSonderzeichen: '" & elementOhneSonderzeichen & "'", False)
' LOGGER.Debug("elementOhneSonderzeichen: '" & elementOhneSonderzeichen & "'", False)
' 'den Platzhalter im SQL-String durch den Wert ersetzen
' Dim manIndexwert As String = GetManIndex_Value(elementOhneSonderzeichen, "IDX_AUTO")
' If manIndexwert <> "" Then
' SqlString = SqlString.Replace(element.Value, manIndexwert)
' If LogErrorsOnly = False Then ClassLogger.Add(" >> zusammengesetzter SQL-String: " & SqlString, False)
' LOGGER.Debug("zusammengesetzter SQL-String: " & SqlString, False)
' Else
' ClassLogger.Add(" - ACHTUNG: manIndexwert = String.Empty - Funktion: FillIndexe_Autom", False)
' Logger.Warn(" - ACHTUNG: manIndexwert = String.Empty - Funktion: FillIndexe_Autom", False)
' Return False
' End If
' Next
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Ausführen SQL....", False)
' LOGGER.Debug("Ausführen SQL....", False)
' Dim automatischerValue As String = ""
' automatischerValue = Get_AutomatischerIndex_SQL(SqlString, DR_AUTOINDEX.Item("CONNECTION_ID"), DR_AUTOINDEX.Item("SQL_PROVIDER"))
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Ergebnis SQL: '" & automatischerValue & "'", False)
' LOGGER.Debug("Ergebnis SQL: '" & automatischerValue & "'", False)
' If automatischerValue <> String.Empty Then
' DR_AUTOINDEX.Item("Indexiert") = True
' DR_AUTOINDEX.Item("Indexwert") = automatischerValue
' Else
' ClassLogger.Add(" - ACHTUNG: automatischerValue = String.Empty - Funktion: FillIndexe_Autom", False)
' ClassLogger.Add(" - SqlString: " & SqlString, False)
' Logger.Warn(" - ACHTUNG: automatischerValue = String.Empty - Funktion: FillIndexe_Autom", False)
' Logger.Warn(" - SqlString: " & SqlString, False)
' Return False
' End If
' Else
@@ -409,7 +409,7 @@ Public Class frmWM_IndexFile
' Dim DEFAULTVALUE As String = DR_AUTOINDEX.Item("VALUE")
' 'Indexierung mit WindowsVariable
' If DEFAULTVALUE.StartsWith("$") Then
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Indexierung mit einer Windowsvariable: '" & DEFAULTVALUE & "'", False)
' LOGGER.Debug("Indexierung mit einer Windowsvariable: '" & DEFAULTVALUE & "'", False)
' Select Case DEFAULTVALUE.ToUpper
' Case "$filename_ext".ToUpper
' DEFAULTVALUE = Path.GetFileName(CURRENT_WORKFILE)
@@ -428,9 +428,9 @@ Public Class frmWM_IndexFile
' Case "$DateDDMMYYY".ToUpper
' DEFAULTVALUE = System.DateTime.Now.ToShortDateString
' End Select
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Ergebnis der Windowsvariable: '" & DEFAULTVALUE & "'", False)
' LOGGER.Debug("Ergebnis der Windowsvariable: '" & DEFAULTVALUE & "'", False)
' Else
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Indexierung mit einem Festen Wert: '" & DEFAULTVALUE & "'", False)
' LOGGER.Debug("Indexierung mit einem Festen Wert: '" & DEFAULTVALUE & "'", False)
' End If
' 'Den Wert in der Zwischentabelle speichern
' DR_AUTOINDEX.Item("Indexiert") = True
@@ -445,7 +445,7 @@ Public Class frmWM_IndexFile
' Return True
' End If
' Catch ex As System.Exception
' ClassLogger.Add(" - Fehler bei FillIndexe_Autom - Fehler: " & vbNewLine & ex.Message)
' Logger.Warn(" - Fehler bei FillIndexe_Autom - Fehler: " & vbNewLine & ex.Message)
' MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei FillIndexe_Autom")
' Return False
' End Try
@@ -617,7 +617,7 @@ Public Class frmWM_IndexFile
AddDateTimePicker(DR.Item("GUID"), DR.Item("NAME"), y)
Case Else
MsgBox($"Please check the datatype of manual index ({ DR.Item("NAME")} - {type} - Refresh_Indices_Manual (frmWMIndexFile)", MsgBoxStyle.Critical, "Achtung:")
ClassLogger.Add(" - Datentyp nicht hinterlegt - LoadIndexe_Man")
LOGGER.Warn(" - Datentyp nicht hinterlegt - LoadIndexe_Man")
End Select
anz += 1
@@ -941,7 +941,7 @@ Public Class frmWM_IndexFile
Next
End If
Catch ex As Exception
ClassLogger.Add(" - Unvorhergesehener Unexpected error in Renew_ComboboxResults - Fehler: " & vbNewLine & ex.Message)
LOGGER.Warn(" - Unvorhergesehener Unexpected error in Renew_ComboboxResults - Fehler: " & vbNewLine & ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in Renew_ComboboxResults:")
End Try
End Sub
@@ -982,7 +982,7 @@ Public Class frmWM_IndexFile
End If
Else
runinLZ = True
If LogErrorsOnly = False Then ClassLogger.Add(" >>sql enthält Platzhalter und wird erst während der Laufzeit gefüllt!", False)
LOGGER.Debug(" >>sql enthält Platzhalter und wird erst während der Laufzeit gefüllt!", False)
End If
@@ -1053,7 +1053,7 @@ Public Class frmWM_IndexFile
End If
Catch ex As Exception
ClassLogger.Add(" - Unvorhergesehener Unexpected error in AddVorschlag_ComboBox - Indexname: " & indexname & " - Fehler: " & vbNewLine & ex.Message)
LOGGER.Warn(" - Unvorhergesehener Unexpected error in AddVorschlag_ComboBox - Indexname: " & indexname & " - Fehler: " & vbNewLine & ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in AddVorschlag_ComboBox:")
End Try
End Sub
@@ -1135,7 +1135,7 @@ Public Class frmWM_IndexFile
CURRENT_FILENAME = ""
Me.VWDDINDEX_AUTOMTableAdapter.Connection.ConnectionString = MyConnectionString
chkMultiIndexer.Checked = False
If LogErrorsOnly = False Then ClassLogger.Add(" >> frmWD_Index_Dokart_Load", False)
LOGGER.Debug("frmWD_Index_Dokart_Load", False)
chkdelete_origin.Checked = False
chkdelete_origin.Visible = False
Dim HandleType As String
@@ -1195,7 +1195,7 @@ Public Class frmWM_IndexFile
MsgBox("No documenttypes for the redundant entity configured either! Indexing is not possible!" & vbNewLine & "Please check the configuration!", MsgBoxStyle.Exclamation)
Exit Sub
Else
If LogErrorsOnly = False Then ClassLogger.Add(" >> Redundant EntityID: " & CURRENT_ENTITY_REDUNDANT_ID)
LOGGER.Debug("Redundant EntityID: " & CURRENT_ENTITY_REDUNDANT_ID)
CURRENT_REDUNDANT_FORM_ID = CURRENT_ENTITY_REDUNDANT_ID
CURRENT_REDUNDANT_FORMVIEW_ID = FVID
CURRENT_ENTITY_ID = CURRENT_ENTITY_REDUNDANT_ID