-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrorLogger.cls
More file actions
40 lines (35 loc) · 968 Bytes
/
ErrorLogger.cls
File metadata and controls
40 lines (35 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "ErrorLogger"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'@Exposed
'@Folder("JSON.Logs")
Option Explicit
Private Type TData
ModuleName As String
FunctionName As String
Loggers As Collection
End Type
Private This As TData
Private Sub Class_Initialize()
Set This.Loggers = New Collection
This.Loggers.Add New LoggerExecutionWindow
This.Loggers.Add New LoggerFile
End Sub
Friend Sub Create(ByVal ModuleName As String, ByVal FunctionName As String)
This.ModuleName = ModuleName
This.FunctionName = FunctionName
End Sub
Private Sub Class_Terminate()
If (Err.Number <> 0) Then
Dim Logger As ILogger
For Each Logger In This.Loggers
Logger.Execute This.ModuleName & "." & This.FunctionName & " : " & Err.Description
Next
End If
End Sub