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

@@ -10,10 +10,11 @@ Public Class ClassHelper
Dim utf8Encoding As New System.Text.UTF8Encoding(True)
Dim encodedString() As Byte
encodedString = utf8Encoding.GetBytes(str)
If LogErrorsOnly = False Then ClassLogger.Add(String.Format(" >> String {0} was encoded via utf8 to {1}", str, utf8Encoding.GetString(encodedString)), False)
LOGGER.Info(String.Format(" >> String {0} was encoded via utf8 to {1}", str, utf8Encoding.GetString(encodedString)))
Return utf8Encoding.GetString(encodedString)
Catch ex As Exception
ClassLogger.Add("Unexpected error in encode_utf8: " & ex.Message)
LOGGER.Info("Unexpected error in encode_utf8: " & ex.Message)
LOGGER.Error(ex.message)
Return Nothing
End Try
@@ -26,7 +27,8 @@ Public Class ClassHelper
' return byte data
Return bytes
Catch ex As Exception
ClassLogger.Add("Unexpected error in StringAsUtf8Bytes: " & ex.Message)
LOGGER.Info("Unexpected error in StringAsUtf8Bytes: " & ex.Message)
LOGGER.Error(ex.message)
Return Nothing
End Try
@@ -37,7 +39,8 @@ Public Class ClassHelper
Dim matches As MatchCollection = Regex.Matches(str, pattern)
Return matches.Count
Catch ex As Exception
ClassLogger.Add("Unexpected error in CheckSpecialSigns: " & ex.Message)
LOGGER.Info("Unexpected error in CheckSpecialSigns: " & ex.Message)
LOGGER.Error(ex.message)
Return 0
End Try
End Function