Henry's App Log

Henry's App Log is a product of Henry's Software

 


1.0

Summary

This is an application event log class I built to log events in desktop apps to a CSV file.

Event Types

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
        T_Information = 0
        T_Error = 1
        T_Warning = 2
        T_Update = 3
        T_Change = 4
        T_Add = 5
        T_New = 6
        T_Save = 7
        T_Delete = 8
        T_None = 9
        T_Successful = 10
        T_Critical = 11
        T_Aborted = 12

How to use

 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
        Imports HenrysAppLog.HAL
Class MainWindow
                                        Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs)
                                        Try
                                        'Settings
            SavePath = Environment.CurrentDirectory & "\"
            FileExtension = ".csv"
            Delimiter = ","
                                        'Add new event log
            AddEventLog("ApplicationName", "Your application loaded successfully...", EventLogType.T_Successful)
                                        'Show Event log data in a DataGrid and set sum filter stuff
                                        'LogFilter = "EventText LIKE '%test%'" 'Use sunthing like this to filter by event text
            OrderBy = "DateTime ASC" 'ASC|DESC (The ORDER BY is used to sort the result-set by one or more columns)
            dg.ItemsSource = GetCollectionForDataGridSource("ApplicationName")
                                        'or
                                        'dg.ItemsSource = GetCollectionForDataGridSource("ApplicationName", EventLogType.T_Successful)
                                        'This will get the number of event log items
                                        'MsgBox(GetNumberOfEventLogs("ApplicationName"))
                                        Catch ex As Exception
            MsgBox(ex.ToString, MsgBoxStyle.Critical)
                                        End Try
                                        End Sub
End Class