2021-12-08 16:06:21 +01:00

24 lines
678 B
VB.net

Imports DigitalData.Modules.Logging
Imports DigitalData.Services.EDMIService.IDB
Public Class BaseClass
Friend LogConfig As LogConfig
Friend Logger As Logger
Public Sub New(pLogConfig As LogConfig)
Dim oClassName = [GetType]().Name
LogConfig = pLogConfig
Logger = pLogConfig.GetLogger(oClassName)
End Sub
Public Sub LogAndThrow(pMessage As String)
Logger.Warn(pMessage)
Throw New ApplicationException(pMessage)
End Sub
Public Sub LogAndThrow(pException As Exception, pMessage As String)
Logger.Error(pException)
Throw New ApplicationException(pMessage, pException)
End Sub
End Class