1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
5 #include "ErrorReporting.h"
7 static char * GetErrLogPath();
8 static char * GetTraceLogPath();
10 // static char *VB_Name = "modErrorReporting";
12 // --- Option Explicit
14 static char *GetErrLogPath()
16 static char *GetErrLogPath;
18 // GetErrLogPath = GET_PATH(WithSlash(App.Path), "Error.log");
19 GetErrLogPath = "Error.log";
24 static char *GetTraceLogPath()
26 static char *GetTraceLogPath;
28 // GetTraceLogPath = GET_PATH(WithSlash(App.Path), "Trace.log");
29 GetTraceLogPath = "Trace.log";
31 return GetTraceLogPath;
34 void Trace(char *Source, char *Message)
36 // Dim Path$, FNum%, bIsOpen As Boolean
37 // Path = GetTraceLogPath()
40 // On Error GoTo TraceEH
41 // Open Path For Append Access Write As FNum
43 // ' --- Print #FNum, Now & " " & Source & " : " & Message
46 // If bIsOpen Then Close FNum
49 void ReportError(char *Source, char *Message)
55 Path = GetErrLogPath();
59 // --- On Error GoTo ReportErrorEH
60 FNum = fopen(Path, "ab");
62 // --- Print #FNum, Now & " SOURCE = " & Source & " ErrMessage = " & Message
63 // --- On Error GoTo 0
71 void InitErrorReporting()
75 Path = GetErrLogPath();
77 Path = GetTraceLogPath();