use Logging Module EVERYWHERE, fix some MarvMan bugs
This commit is contained in:
@@ -13,7 +13,7 @@ Public Class ClassFolderWatcher
|
||||
FW_started = False
|
||||
'FolderWatch neu instanzieren
|
||||
FolderWatcher = New System.IO.FileSystemWatcher(CURRENT_FOLDERWATCH, "*.*")
|
||||
ClassLogger.Add(" >> FolderWatch neu instanziert", False)
|
||||
LOGGER.Info(" >> FolderWatch neu instanziert")
|
||||
FolderWatcher.IncludeSubdirectories = False
|
||||
FolderWatcher.EnableRaisingEvents = True
|
||||
AddHandler FolderWatcher.Created, AddressOf OnCreated
|
||||
@@ -23,7 +23,8 @@ Public Class ClassFolderWatcher
|
||||
CONFIG.Save()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add($"Error in Restart_FolderWatch: {ex.Message}", False)
|
||||
LOGGER.Info($"Error in Restart_FolderWatch: {ex.Message}")
|
||||
LOGGER.Error(ex.Message)
|
||||
End Try
|
||||
End Function
|
||||
Public Shared Function Restart_FolderWatchSCAN()
|
||||
@@ -33,7 +34,7 @@ Public Class ClassFolderWatcher
|
||||
FolderWatcher_SCAN.EnableRaisingEvents = False
|
||||
'FolderWatch neu instanzieren
|
||||
FolderWatcher_SCAN = New System.IO.FileSystemWatcher(CURRENT_SCAN_FOLDERWATCH, "*.*")
|
||||
ClassLogger.Add(" >> FolderWatchScan neu instanziert", False)
|
||||
LOGGER.Info(" >> FolderWatchScan neu instanziert")
|
||||
FolderWatcher_SCAN.IncludeSubdirectories = False
|
||||
FolderWatcher_SCAN.EnableRaisingEvents = True
|
||||
AddHandler FolderWatcher_SCAN.Created, AddressOf OnCreated
|
||||
@@ -42,7 +43,8 @@ Public Class ClassFolderWatcher
|
||||
CONFIG.Save()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add($"Error in Restart_FolderWatchSCAN: {ex.Message}", False)
|
||||
LOGGER.Info($"Error in Restart_FolderWatchSCAN: {ex.Message}")
|
||||
LOGGER.Error(ex.Message)
|
||||
End Try
|
||||
End Function
|
||||
Public Shared Function StartStop_FolderWatch()
|
||||
@@ -53,7 +55,7 @@ Public Class ClassFolderWatcher
|
||||
End If
|
||||
If FolderWatcher Is Nothing Then
|
||||
FolderWatcher = New System.IO.FileSystemWatcher(CURRENT_FOLDERWATCH, "*.*")
|
||||
ClassLogger.Add(" >> FolderWatch Gestartet", False)
|
||||
LOGGER.Info(" >> FolderWatch Gestartet")
|
||||
FolderWatcher.IncludeSubdirectories = False
|
||||
FolderWatcher.EnableRaisingEvents = True
|
||||
AddHandler FolderWatcher.Created, AddressOf OnCreated
|
||||
@@ -67,7 +69,7 @@ Public Class ClassFolderWatcher
|
||||
' Dim watcher As New FileSystemWatcher()
|
||||
' watcher.Path = CURRENT_FOLDERWATCH
|
||||
FolderWatcher = New System.IO.FileSystemWatcher(CURRENT_FOLDERWATCH, "*.*")
|
||||
ClassLogger.Add(" >> FolderWatch Gestartet", False)
|
||||
LOGGER.Info(" >> FolderWatch Gestartet")
|
||||
FolderWatcher.IncludeSubdirectories = False
|
||||
FolderWatcher.EnableRaisingEvents = True
|
||||
AddHandler FolderWatcher.Created, AddressOf OnCreated
|
||||
@@ -80,7 +82,7 @@ Public Class ClassFolderWatcher
|
||||
'Gestartet also Stoppen
|
||||
FolderWatcher.EnableRaisingEvents = False
|
||||
FW_started = False
|
||||
ClassLogger.Add(" >> FolderWatch gestoppt", False)
|
||||
LOGGER.Info(" >> FolderWatch gestoppt")
|
||||
'SaveConfigValue("FW_started", "False")
|
||||
CONFIG.Config.FolderWatchStarted = False
|
||||
CONFIG.Save()
|
||||
@@ -88,7 +90,7 @@ Public Class ClassFolderWatcher
|
||||
End If
|
||||
'If watcher.EnableRaisingEvents = False Then
|
||||
' watcher = New System.IO.FileSystemWatcher(CURRENT_FOLDERWATCH, "*.*")
|
||||
' ClassLogger.Add(" - vFolderWatch.Gestartet", False)
|
||||
' LOGGER.Info(" - vFolderWatch.Gestartet")
|
||||
' watcher.IncludeSubdirectories = False
|
||||
' watcher.EnableRaisingEvents = True
|
||||
' AddHandler watcher.Created, AddressOf OnCreated
|
||||
@@ -121,7 +123,7 @@ Public Class ClassFolderWatcher
|
||||
End If
|
||||
If FolderWatcher_SCAN Is Nothing Then
|
||||
FolderWatcher_SCAN = New System.IO.FileSystemWatcher(CURRENT_SCAN_FOLDERWATCH, "*.*")
|
||||
ClassLogger.Add(" >> FolderWatch Scan Gestartet", False)
|
||||
LOGGER.Info(" >> FolderWatch Scan Gestartet")
|
||||
FolderWatcher_SCAN.IncludeSubdirectories = False
|
||||
FolderWatcher_SCAN.EnableRaisingEvents = True
|
||||
AddHandler FolderWatcher_SCAN.Created, AddressOf OnCreated
|
||||
@@ -133,7 +135,7 @@ Public Class ClassFolderWatcher
|
||||
' Dim watcher As New FileSystemWatcher()
|
||||
' watcher.Path = CURRENT_FOLDERWATCH
|
||||
FolderWatcher_SCAN = New System.IO.FileSystemWatcher(CURRENT_SCAN_FOLDERWATCH, "*.*")
|
||||
ClassLogger.Add(" >> FolderWatch Scan Gestartet", False)
|
||||
LOGGER.Info(" >> FolderWatch Scan Gestartet")
|
||||
FolderWatcher_SCAN.IncludeSubdirectories = False
|
||||
FolderWatcher_SCAN.EnableRaisingEvents = True
|
||||
AddHandler FolderWatcher_SCAN.Created, AddressOf OnCreated
|
||||
@@ -143,13 +145,13 @@ Public Class ClassFolderWatcher
|
||||
Else
|
||||
'Gestartet also Stoppen
|
||||
FolderWatcher_SCAN.EnableRaisingEvents = False
|
||||
ClassLogger.Add(" >> FolderWatch Scan gestoppt", False)
|
||||
LOGGER.Info(" >> FolderWatch Scan gestoppt")
|
||||
'SaveConfigValue("FWSCAN_started", "False")
|
||||
CONFIG.Config.FolderWatchScanStarted = False
|
||||
CONFIG.Save()
|
||||
Return 0
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in StartStop_FolderWatchSCAN:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
Return 99
|
||||
@@ -160,7 +162,7 @@ Public Class ClassFolderWatcher
|
||||
'Gestartet also Stoppen
|
||||
FolderWatcher.EnableRaisingEvents = False
|
||||
FW_started = False
|
||||
ClassLogger.Add(" >> FolderWatch gestoppt", False)
|
||||
LOGGER.Info(" >> FolderWatch gestoppt")
|
||||
'SaveConfigValue("FW_started", "False")
|
||||
CONFIG.Config.FolderWatchStarted = True
|
||||
CONFIG.Save()
|
||||
@@ -171,7 +173,7 @@ Public Class ClassFolderWatcher
|
||||
End Function
|
||||
Private Shared Sub OnCreated(source As Object, e As FileSystemEventArgs)
|
||||
If ClassDatabase.DatabaseConnectionTimeout = True Then
|
||||
ClassLogger.Add(">> File handling aborted because of database timeout error!", False)
|
||||
LOGGER.Info(">> File handling aborted because of database timeout error!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -190,11 +192,11 @@ Public Class ClassFolderWatcher
|
||||
handleType = "|FW_SIMPLEINDEXER|"
|
||||
End If
|
||||
'Die Datei übergeben
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(">> OnCreated-File:" & e.FullPath, False)
|
||||
LOGGER.Info(">> OnCreated-File:" & e.FullPath)
|
||||
If ClassIndexFunctions.FileExistsinDropTable(e.FullPath) = False Then
|
||||
ClassFilehandle.Decide_FileHandle(e.FullPath, handleType)
|
||||
Else
|
||||
ClassLogger.Add(">> Folderwatcher: File already exists:" & e.FullPath, False)
|
||||
LOGGER.Info(">> Folderwatcher: File already exists:" & e.FullPath)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
Reference in New Issue
Block a user