Use Logger Module

This commit is contained in:
Jonathan Jenne
2019-04-16 14:01:35 +02:00
parent 4c86bd4c5c
commit 31bf65a5f0
37 changed files with 938 additions and 859 deletions

View File

@@ -54,6 +54,7 @@ Public Class frmAdministration
tabctrl_Profilkonfig.SelectedIndex = 0
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Laden der Wertehilfen und Konfig-Daten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
@@ -63,6 +64,7 @@ Public Class frmAdministration
'Windream initialisieren (Connection, Session, ... aufbauen)
'_windreamPM.Create_Session()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
ObjekttypenEintragen()
@@ -79,6 +81,7 @@ Public Class frmAdministration
Next
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Indexe_eintragen: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
End Sub
@@ -119,6 +122,7 @@ Public Class frmAdministration
cmbLOGIndex.SelectedIndex = -1
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Indexe_eintragen: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
PM_VEKTOR_INDEXComboBox.SelectedIndex = -1
cmbLOGIndex.SelectedIndex = -1
@@ -145,6 +149,7 @@ Public Class frmAdministration
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Refresh_Profildaten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
@@ -158,6 +163,7 @@ Public Class frmAdministration
Me.cmbObjekttypen.Items.Add(aType.aName)
Next
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Es konnte keine Verbindung zum windream-Server hergestellt werden.", MsgBoxStyle.Critical, "Fehler beim Zugriff auf windream-Server")
End Try
@@ -184,6 +190,7 @@ Public Class frmAdministration
p.Close()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei öffnen der windream-Suche:")
End Try
End Sub
@@ -198,6 +205,7 @@ Public Class frmAdministration
tstrlblSave.Visible = False
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Speichern des Profils:")
End Try
@@ -267,6 +275,7 @@ Public Class frmAdministration
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Laden der User zu Profil:")
End Try
End Sub
@@ -295,6 +304,7 @@ Public Class frmAdministration
FillProfile_User(profileId)
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox($"Error while calling FillProfile_User", MsgBoxStyle.Critical)
End Try
End If
@@ -308,6 +318,7 @@ Public Class frmAdministration
TBPROFILE_USERTableAdapter.CMDInsert(profileId, userId, Environment.UserName)
FillProfile_User(profileId)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen eines Users:")
End Try
End Sub
@@ -321,6 +332,7 @@ Public Class frmAdministration
TBPROFILE_USERTableAdapter.CmdDelete(profileId, userId)
FillProfile_User(profileId)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Entfernen eines Users:")
End Try
End Sub
@@ -336,6 +348,7 @@ Public Class frmAdministration
' TBPROFILE_USERTableAdapter.CMDInsert(profileId, userId, Environment.UserName)
FillProfile_User(profileId)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen einer Gruppe:")
End Try
End Sub
@@ -351,6 +364,7 @@ Public Class frmAdministration
'TBPROFILE_USERTableAdapter.cmdDelete(userId)
FillProfile_User(profileId)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Entfernen einer Gruppe:")
End Try
End Sub
@@ -429,6 +443,7 @@ Public Class frmAdministration
TBPM_ERROR_LOGTableAdapter.CmdDelete()
Refresh_log()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Delete Log:")
End Try
End Sub
@@ -436,6 +451,7 @@ Public Class frmAdministration
Try
Me.TBPM_ERROR_LOGTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_ERROR_LOG)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Refresh Error:")
End Try
End Sub
@@ -625,6 +641,7 @@ Public Class frmAdministration
Refresh_Profildaten()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Anlage Profilkopie:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:")
End Try
@@ -640,6 +657,7 @@ Public Class frmAdministration
SQLconnection.Close()
Return True
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler in Execute_SQL: " & vbNewLine & ex.Message & vbNewLine & vbNewLine & " SQL: " & SQL)
Return False
End Try
@@ -662,6 +680,7 @@ Public Class frmAdministration
MsgBox("Das Profil " & NAMETextBox.Text & " wurde erfolgreich gelöscht!", MsgBoxStyle.Information, "Erfolgsmeldung")
Refresh_Profildaten()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Löschen des Profils:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:")
End Try
@@ -726,6 +745,7 @@ Public Class frmAdministration
Try
Me.TBDD_USERTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBDD_USER)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei LoadUsers: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:")
End Try
End Sub
@@ -903,6 +923,7 @@ Public Class frmAdministration
Process.Start(USER_MANAGER_PATH)
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error while startign User Manager:" & vbCrLf & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
@@ -992,8 +1013,9 @@ Public Class frmAdministration
PropertyGrid1.SelectedObject = obj
PropertyGrid1.Refresh()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox($"Error while loading Final Index properties: {ex.Message}")
ClassLogger.Add($"Error while loading Final Index properties: {ex.Message}")
LOGGER.Info($"Error while loading Final Index properties: {ex.Message}")
End Try
End Sub
@@ -1066,8 +1088,9 @@ Public Class frmAdministration
Refresh_Final_indexe()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error while Saving Final Index: " & ex.Message, MsgBoxStyle.Critical)
ClassLogger.Add("Error while Saving Final Index: " & ex.Message)
LOGGER.Info("Error while Saving Final Index: " & ex.Message)
Finally
tsBtnCancel.Visible = False
BindingNavigatorAddNewItem.Visible = True