Advertisement
ASP_Volume2 Debugging and Error Handling #26845

Application Logger

This class provides a logging object that you can create and destroy as you like, the properties it has are: CurrentProcedure LogFile LogLevel MaxFileIterations MaxFileSize The methods are: BeginLogging StopLogging IUPrint If you create a global clsLogger object, in each procedure you can pass .CurrentProcedure the name of the procedure as a string. Anytime you want to log some data, use the IUPrint method to write out to the file. The logfile is kept open for the duration of your application to save time, the WriteFile API is used for this purpose also. The IUPrint method takes the LogLevel of the message, the message itself and a parameter array of other data you'd like to write to the file. The levels work like this: clslogger.LogLevel is set at 3, an IUPrint is processed passing a level of 5, IUPrint will not write it out to the file clslogger.LogLevel is set at 3, an IUPrint is processed passing a level of 2, IUPrint will write it out to the file. This way, you can up or down the level of logging to conserve log file size. LogFile is the name of the file to be logged to. It will have a .Log extension, unless you make use of the File Iteration feature. File Iteration allows you to save to files until they reach a certain size(MaxFileSize), it will then change the extension to 002, 003 etc., until MaxFileIterations is met, then it will revert back to 001 again. LogFile is the name of the initial logfile, without an extension.

AI

AI Samenvatting: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Broncode
original-source
Upload
Originele reacties (3)
Hersteld van de Wayback Machine