Documentation update
This commit is contained in:
@@ -409,7 +409,7 @@ end;
|
|||||||
constructor TAGMultiLog.Create(ALogs:TLogsList=nil);
|
constructor TAGMultiLog.Create(ALogs:TLogsList=nil);
|
||||||
begin
|
begin
|
||||||
//inherited Create;
|
//inherited Create;
|
||||||
if Default<>nil then
|
if ALogs<>nil then
|
||||||
Logs:=ALogs
|
Logs:=ALogs
|
||||||
else
|
else
|
||||||
Logs:=TLogsList.Create;
|
Logs:=TLogsList.Create;
|
||||||
|
|||||||
40
DOC_EN.MD
40
DOC_EN.MD
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
# Description of AG.Logs library
|
# Description of AG.Logs library
|
||||||
|
|
||||||
## TAGLog
|
## TAGLog = class abstract
|
||||||
|
|
||||||
It is abstract class for using in any parts of code.
|
It is abstract class for using in any parts of code.
|
||||||
|
|
||||||
@@ -9,26 +9,26 @@ It is abstract class for using in any parts of code.
|
|||||||
|
|
||||||
+ #### class function GenerateLogString(const s:string;o:TObject=nil):string;static;
|
+ #### class function GenerateLogString(const s:string;o:TObject=nil):string;static;
|
||||||
|
|
||||||
Function for add time and object information (if o is not nil) to string
|
Function for add time and object information (if o is not nil) to string.
|
||||||
|
|
||||||
+ #### procedure Indent();
|
+ #### procedure Indent();
|
||||||
|
|
||||||
Procedure for add ident to all next strings.
|
Procedure for add indent to all next strings.
|
||||||
|
|
||||||
+ #### procedure UnIndent();
|
+ #### procedure UnIndent();
|
||||||
|
|
||||||
Procedure for remove ident from all next strings.
|
Procedure for remove indent from all next strings.
|
||||||
|
|
||||||
+ #### procedure Write(const Text:string;o:TObject=nil);
|
+ #### procedure Write(const Text:string;o:TObject=nil);
|
||||||
|
|
||||||
Write string in log.
|
Procedure for writing string in log.
|
||||||
|
|
||||||
+ #### property IndentText:string;
|
+ #### property IndentText:string;
|
||||||
|
|
||||||
String what using as indent symbol in log string. Default is DefOneTabStr const(two spaces).
|
String what using as indent symbol in logs. Default value is DefOneTabStr const(two spaces).
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGRamLog
|
## TAGRamLog = class(TAGLog)
|
||||||
|
|
||||||
Write log in RAM buffer.
|
Write log in RAM buffer.
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ Write log in RAM buffer.
|
|||||||
Buffer when you can find log.
|
Buffer when you can find log.
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGDiskLog
|
## TAGDiskLog = class(TAGLog)
|
||||||
|
|
||||||
File log.
|
File log.
|
||||||
|
|
||||||
@@ -50,12 +50,14 @@ File log.
|
|||||||
Use to create log from file name. If file not exist if will created.
|
Use to create log from file name. If file not exist if will created.
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGNullLog
|
## TAGNullLog = class(TAGLog)
|
||||||
|
|
||||||
|
Doesn't do anything.
|
||||||
|
|
||||||
Use if you don't need log, but don't want del logging from code.
|
Use if you don't need log, but don't want del logging from code.
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGCommandLineLog
|
## TAGCommandLineLog = class(TAGLog)
|
||||||
|
|
||||||
Write log to command line.
|
Write log to command line.
|
||||||
|
|
||||||
@@ -68,18 +70,18 @@ Write log to command line.
|
|||||||
`Log:=TAGCommandLineLog.Create(GetStdHandle(STD_OUTPUT_HANDLE));`
|
`Log:=TAGCommandLineLog.Create(GetStdHandle(STD_OUTPUT_HANDLE));`
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGStreamLog
|
## TAGStreamLog = class(TAGLog)
|
||||||
|
|
||||||
Write log to pascal stream.
|
Write log to pascal stream (TStream).
|
||||||
|
|
||||||
### public metods & propertys
|
### public metods & propertys
|
||||||
|
|
||||||
+ #### constructor Create(Astream:TStream);
|
+ #### constructor Create(Astream:TStream);
|
||||||
|
|
||||||
Use to create log from pascal stream.
|
Use to create log from pascal stream (TStream).
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGCallBackLog
|
## TAGCallBackLog = class(TAGLog)
|
||||||
|
|
||||||
Write log to callback.
|
Write log to callback.
|
||||||
|
|
||||||
@@ -96,9 +98,9 @@ Write log to callback.
|
|||||||
Use to create log from callback.
|
Use to create log from callback.
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGMultiLog
|
## TAGMultiLog = class(TAGLog)
|
||||||
|
|
||||||
Write all to other logs.
|
Writes several logs.
|
||||||
|
|
||||||
### public metods & propertys
|
### public metods & propertys
|
||||||
|
|
||||||
@@ -110,8 +112,4 @@ Write all to other logs.
|
|||||||
|
|
||||||
+ #### constructor Create(ALogs:TLogsList);
|
+ #### constructor Create(ALogs:TLogsList);
|
||||||
|
|
||||||
Use to create log from TLogsList. If ALogs is nil.
|
Use to create log from TLogsList. If ALogs is nil will used empty list.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
80
DOC_RU.MD
80
DOC_RU.MD
@@ -1,117 +1,115 @@
|
|||||||
|
|
||||||
# Description of AG.Logs library
|
# Описание of AG.Logs library
|
||||||
|
|
||||||
## TAGLog
|
## TAGLog = class abstract
|
||||||
|
|
||||||
It is abstract class for using in any parts of code.
|
Это абстрактный класс для использования в любых местах кода.
|
||||||
|
|
||||||
### public metods & propertys
|
### Публичные методы и свойства
|
||||||
|
|
||||||
+ #### class function GenerateLogString(const s:string;o:TObject=nil):string;static;
|
+ #### class function GenerateLogString(const s:string;o:TObject=nil):string;static;
|
||||||
|
|
||||||
Function for add time and object information (if o is not nil) to string
|
Функция для добавления времени и информации об объекте (если o не nil) в строку.
|
||||||
|
|
||||||
+ #### procedure Indent();
|
+ #### procedure Indent();
|
||||||
|
|
||||||
Procedure for add ident to all next strings.
|
Процедура для добавления отступа ко всем следующим строкам.
|
||||||
|
|
||||||
+ #### procedure UnIndent();
|
+ #### procedure UnIndent();
|
||||||
|
|
||||||
Procedure for remove ident from all next strings.
|
Процедура для удаления отступа из всех следующих строк.
|
||||||
|
|
||||||
+ #### procedure Write(const Text:string;o:TObject=nil);
|
+ #### procedure Write(const Text:string;o:TObject=nil);
|
||||||
|
|
||||||
Write string in log.
|
Запись строки в лог.
|
||||||
|
|
||||||
+ #### property IndentText:string;
|
+ #### property IndentText:string;
|
||||||
|
|
||||||
String what using as indent symbol in log string. Default is DefOneTabStr const(two spaces).
|
Строка, которая используется как символ отступа в логах. Значение по умолчанию рано константе DefOneTabStr(два пробела).
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGRamLog
|
## TAGRamLog = class(TAGLog)
|
||||||
|
|
||||||
Write log in RAM buffer.
|
Пишет лог в бувер в опереативной памяти.
|
||||||
|
|
||||||
### public metods & propertys
|
### Публичные методы и свойства
|
||||||
|
|
||||||
+ #### buf:String;
|
+ #### buf:String;
|
||||||
|
|
||||||
Buffer when you can find log.
|
Буфер куда ведётся логирование.
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGDiskLog
|
## TAGDiskLog = class(TAGLog)
|
||||||
|
|
||||||
File log.
|
Файловый лог.
|
||||||
|
|
||||||
### public metods & propertys
|
### Публичные методы и свойства
|
||||||
|
|
||||||
+ #### constructor Create(const FileName:String);
|
+ #### constructor Create(const FileName:String);
|
||||||
|
|
||||||
Use to create log from file name. If file not exist if will created.
|
Используйте чтобы создать лог по имени вайла. If file not exist if will created.
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGNullLog
|
## TAGNullLog = class(TAGLog)
|
||||||
|
|
||||||
Use if you don't need log, but don't want del logging from code.
|
Не делает ничего.
|
||||||
|
|
||||||
|
Используйте если вы не нуждатесь в логе, но не хотоите удалять логироание из кода.
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGCommandLineLog
|
## TAGCommandLineLog = class(TAGLog)
|
||||||
|
|
||||||
Write log to command line.
|
Пишет лог в командную строку.
|
||||||
|
|
||||||
### public metods & propertys
|
### Публичные методы и свойства
|
||||||
|
|
||||||
+ #### constructor Create(Handele:THandle);
|
+ #### constructor Create(Handele:THandle);
|
||||||
|
|
||||||
Use to create log from winapi handle. Use as:
|
Используйте чтгобы создать лог по winapi handle'у. Пример использования:
|
||||||
|
|
||||||
`Log:=TAGCommandLineLog.Create(GetStdHandle(STD_OUTPUT_HANDLE));`
|
`Log:=TAGCommandLineLog.Create(GetStdHandle(STD_OUTPUT_HANDLE));`
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGStreamLog
|
## TAGStreamLog = class(TAGLog)
|
||||||
|
|
||||||
Write log to pascal stream.
|
Пишел лог в поток паскаля (TStream).
|
||||||
|
|
||||||
### public metods & propertys
|
### Публичные методы и свойства
|
||||||
|
|
||||||
+ #### constructor Create(Astream:TStream);
|
+ #### constructor Create(Astream:TStream);
|
||||||
|
|
||||||
Use to create log from pascal stream.
|
Используйте чтобы создать лог из потока паскаля (TStream).
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGCallBackLog
|
## TAGCallBackLog = class(TAGLog)
|
||||||
|
|
||||||
Write log to callback.
|
Пишел лог в callback-процедуру (TStream).
|
||||||
|
|
||||||
### public metods & propertys
|
### Публичные методы и свойства
|
||||||
|
|
||||||
+ #### TCallBack
|
+ #### TCallBack
|
||||||
|
|
||||||
Type. In delphi it is anonimus procedure, in free pascal - standart procedure. Declaration:
|
Тип данных. В delphi это анонимная процедура, во free pascal'е - обычная процедура. Объявление:
|
||||||
|
|
||||||
`TCallBack={$IFNDEF FPC}reference to{$ENDIF}procedure(s:string);`
|
`TCallBack={$IFNDEF FPC}reference to{$ENDIF}procedure(s:string);`
|
||||||
|
|
||||||
+ #### constructor Create(ACallBack:TCallBack);
|
+ #### constructor Create(ACallBack:TCallBack);
|
||||||
|
|
||||||
Use to create log from callback.
|
Используйте чтобы создать лог из callback'а.
|
||||||
|
|
||||||
********************************************
|
********************************************
|
||||||
## TAGMultiLog
|
## TAGMultiLog = class(TAGLog)
|
||||||
|
|
||||||
Write all to other logs.
|
Пишет несколько логов.
|
||||||
|
|
||||||
### public metods & propertys
|
### Публичные методы и свойства
|
||||||
|
|
||||||
+ #### TLogsList
|
+ #### TLogsList
|
||||||
|
|
||||||
Type for list of logs. In delphi it is `System.Generics.Collections.TList`, in free pascal - `FGL.TFPGList`. Declaration:
|
Тип для списка логов. В delphi это `System.Generics.Collections.TList`, во free pascal'е - `FGL.TFPGList`. Объявление:
|
||||||
|
|
||||||
`TLogsList={$IFDEF FPC}specialize TFPGList<TAGLog>{$ELSE}TList<TAGLog>{$ENDIF}`
|
`TLogsList={$IFDEF FPC}specialize TFPGList<TAGLog>{$ELSE}TList<TAGLog>{$ENDIF}`
|
||||||
|
|
||||||
+ #### constructor Create(ALogs:TLogsList);
|
+ #### constructor Create(ALogs:TLogsList);
|
||||||
|
|
||||||
Use to create log from TLogsList. If ALogs is nil.
|
Используйте чтобы создать лог из TLogsList'a. Если ALogs равен nil, будет использоваться пустой список.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user