-
-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New sample for TLoggerProFileByFolderAppender
- Loading branch information
1 parent
59be284
commit b3ca81b
Showing
3 changed files
with
1,160 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
lib/loggerpro/samples/02b_file_appender_by_folder/LoggerProConfig.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
15 changes: 15 additions & 0 deletions
15
lib/loggerpro/samples/02b_file_appender_by_folder/file_appender_by_folder.dpr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
Oops, something went wrong.