1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
5 #include "ErrorReporting.h"
7 static char * GetErrLogPath();
8 static char * GetTraceLogPath();
10 static char *VB_Name = "modErrorReporting";
11 // --- Option Explicit
13 static char *GetErrLogPath()
15 static char *GetErrLogPath;
17 // GetErrLogPath = GET_PATH(WithSlash(App.Path), "Error.log");
18 GetErrLogPath = "Error.log";
23 static char *GetTraceLogPath()
25 static char *GetTraceLogPath;
27 // GetTraceLogPath = GET_PATH(WithSlash(App.Path), "Trace.log");
28 GetTraceLogPath = "Trace.log";
30 return GetTraceLogPath;
33 void Trace(char *Source, char *Message)
35 // Dim Path$, FNum%, bIsOpen As Boolean
36 // Path = GetTraceLogPath()
39 // On Error GoTo TraceEH
40 // Open Path For Append Access Write As FNum
42 // ' --- Print #FNum, Now & " " & Source & " : " & Message
45 // If bIsOpen Then Close FNum
48 void ReportError(char *Source, char *Message)
54 Path = GetErrLogPath();
58 // --- On Error GoTo ReportErrorEH
59 FNum = fopen(Path, "ab");
61 // --- Print #FNum, Now & " SOURCE = " & Source & " ErrMessage = " & Message
62 // --- On Error GoTo 0
70 void InitErrorReporting()
74 Path = GetErrLogPath();
76 Path = GetTraceLogPath();