Логгер Приложение – VB 6.0 – База кода

Скачать

Название (оригинал): 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.

Рус (машинный)Этот класс предоставляет объект ведение журналов, которые можно создавать и уничтожать, как вам нравится, свойствами его являются:
CurrentProcedure
Журнал
Мышиloglevel
MaxFileIterations
Параметра maxfilesize

Методы:
BeginLogging
StopLogging
IUPrint

Если вы создаете глобальный объект clsLogger, в каждой процедуре вы можете пройти .CurrentProcedure имя процедуры, как струна. В любое время вы хотите, чтобы войти некоторые данные, использование метода IUPrint для записи в файл. Файл журнала хранится открытым в течение вашего приложения для экономии времени, функция writefile API используется для этой цели.
Метод IUPrint принимает параметр loglevel сообщения, само сообщение и параметр массив других данных, которые нужно записать в файл. Уровень работы такой:
clslogger.Уровень устанавливается на уровне 3, в IUPrint обрабатывается прохождение уровень 5, IUPrint не буду писать его в файл
clslogger.Уровень устанавливается на 3, в IUPrint обрабатывается прохождение уровень 2, IUPrint будет записать его в файл.
Таким образом, Вы можете вверх или вниз уровень ведения журнала для экономии размера файла журнала.
Лог-файл-это имя файла, который будет регистрироваться. Он будет иметь .Расширение log, если вы используете функцию повторения файл. Файл итерации позволяет сохранить в файлы, пока они не достигнут определенного размера(файла), затем меняете расширение на 002, 003 и т. д., пока MaxFileIterations, а затем его снова вернуться к 001.
Журнал-имя первоначального лог-файл, без расширения.

база кода