Our Products
Classes
BMP
Crypto
CSVStrings
DataLogger
Dates
DebugRecorder
FileNameSet
FileSender
RDOConnectMaster
ReportAids
Sheller
StringSet
WEBUtilities
Modules
DAOLib
Globals
Registry
Programs
Batcher
HTMLGen
KillTime
TimedMessage
|
DebugRecorder implements a recorder of debugging information with a special
twist. If an error occurs during program execution, the debug information, whether
debugging is enabled or not, is automatically sent via e-Mail to the destination/s of your choice.
We use this class in every program we create and liberally output debugging information during processing so
we can easily chase down and solve problems. Its automatic mailing feature has allowed us to solve problems before users became aware of them.
The debug file is controlled either via a set of properties or the [Debug] section of an INI file whose name and location are defaulted to the name and location of the using application or provided via a call to SetupINI before the first debug recording is made.
No need to setup the INI file; the code sets it up for you with default values with its first use. Then tailor it as needed.
You use the Record method to make a recording which is automatically date/time stamped.
You can also note specific errors using the LogError method. At the end of program execution, an e-Mail message
containing the debug file will be sent according to the name or names provided in the ErrorPOC setting if LogError is
used.
The Substitutions property lets you define symbolic string substitutions in the form of aa='character_string' (aa is any character pair) that may be referenced in the DebugFile property. This allows a program to support dynamic naming of the debug file; a real plus for debugging Internet appplications.
Requires CSVStrings class (symbolic substitutions), FileSender class (automatic error message mailing), and Microsoft Scripting Runtime (SCRRUN.dll) To see sample use of DebugRecorder and its full interface definition, scroll down. |
|
| Here is a example of the setup and use of the DebugRecorder. It creates the object, lets it know
where the home directory is and the name of the .INI file, and records a line of debug information. |
Global dbg As DebugRecorder 'declare logging object
Set dbg = New DebugRecorder 'create the object
Call dbg.SetupIni(ThePath, IniFileName)
'tell it where home is; name of .INI file
Call dbg.WriteLog(s) 'write entry to debug file
|
| This is a portion of the .INI file for a program using DebugRecorder. Debug is set to 0/1 to control whether
debug data is actually recorded and PrintDebug is set to N/Y to control printing of the accumulated debug data
when the program terminates. The ErrorPOC entry is used to send the debug data to two individuals if an error is
noted during program execution. The DebugFile entry provides for a dynamically named debug file that includes a
Unit ID, and Employee Number, and the time of day as defined via the Substitutions property. |
.
.
[Debug]
Debug=1
PrintDebug=N
ErrorPOC='Bill Kandler','Angelique Le'
DebugFile=ETC%U%E%T.TXT.
.
|
| The following is the interface definition for the DebugRecorder Class |
Public Property Let Substitutions(ByVal NewSubs As String)
' Sets substitution parameters
' Substitutions is a CSV string of substitutions that can be made on
' the debug file name such as "%U=LAX,%E=1245" would cause a file name
' of "DBG%U%E.txt" to become DBGLAX1245.txt.
Public Property Get Recording() As Boolean
' Returns TRUE if debug is being recorded
Public Property Get Error() As String
' Get text of last error. Use clears text.
Public Sub SetupIni(APath As String, AnIniFile As String)
' Sets MyPath, MyIniFileName
Public Sub LogError(ByVal ErrorString As String)
' Log that an error has been found
Public Sub Record(DbgStr As String) 'Record debugging text
|
|