New sample for TLoggerProFileByFolderAppender

This commit is contained in:
Daniele Teti 2024-05-29 23:21:34 +02:00
parent 59be2840ab
commit b3ca81b523
3 changed files with 1160 additions and 0 deletions

View File

@ -0,0 +1,31 @@
unit LoggerProConfig;
interface
uses
LoggerPro;
function Log: ILogWriter;
implementation
uses
LoggerPro.FileAppender;
var
_Log: ILogWriter;
function Log: ILogWriter;
begin
Result := _Log;
end;
initialization
// Create up to 10 logs in the exe\logs folder, max 2MiB each, using DEFAULT_FILENAME_FORMAT = '{module}.{number}.log';
_Log := BuildLogWriter([
TLoggerProFileByFolderAppender.Create(10, 2048, 'logs')
]);
end.

View File

@ -0,0 +1,15 @@
program file_appender_by_folder;
uses
Vcl.Forms,
LoggerProConfig in 'LoggerProConfig.pas',
MainFormU in '..\common\MainFormU.pas' {MainForm};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.

File diff suppressed because it is too large Load Diff