Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sample for Quick.Log #138

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Quick.Log.pas
Original file line number Diff line number Diff line change
@@ -178,6 +178,7 @@ function TQuickLog.SetLog(logname : string; AddCurrentDateToFileName : Boolean;
fHideHour := True;
fCurrentDateToFileName := AddCurrentDateToFileName;
fLogFileName := logname;
logname := GetLogFileName;
//Checks if logfile is too big and deletes
fLimitLogSize := LimitSizeInMB * 1024 * 1024;
if (fLimitLogSize > 0) and (TFile.Exists(logname)) then
33 changes: 33 additions & 0 deletions samples/delphi/QuickLog/QuickLogDemo.dpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
program QuickLogDemo;

{$APPTYPE CONSOLE}

{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}

{$R *.res}

uses
Quick.Log, Quick.Commons;

begin
Log := TQuickLog.Create;
try
Log.SetLog('.\QuickDemo.log', True, 50);
Log.Add('QuickLogDemo Start', etTrace);

Log.Add('Info', etInfo);
Log.Add('Success', etSuccess);
Log.Add('Warning', etWarning);
Log.Add('Error', etError);
Log.Add('Debug', etDebug);
Log.Add('Done', etDone);
Log.Add('Critical', etCritical);
Log.Add('Exception', etException);

Log.Add('QuickLogDemo End', etTrace);
finally
Log.Free;
end;
end.
Loading
Oops, something went wrong.