-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
693 additions
and
0 deletions.
There are no files selected for viewing
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,39 @@ | ||
program BasicConsoleDemo; | ||
|
||
{$APPTYPE CONSOLE} | ||
|
||
{$R *.res} | ||
|
||
uses | ||
System.SysUtils, | ||
ujachLogAuto in '..\..\src\ujachLogAuto.pas', | ||
UjachLogMgr in '..\..\src\UjachLogMgr.pas'; | ||
|
||
begin | ||
try | ||
jachLog.LogInfo('Program started'); | ||
jachLog.IncIndent; | ||
jachLog.LogInfo('This is an example of how to use the log class in a console application. In this case, thanks to the ujachLogAuto unit, ' | ||
+ 'the same log will be printed to console and writed to a disk file that will preserve the output'#13 | ||
+ 'To make the example look like a real process, we will add some entries to the log that simulates a real processing' | ||
); | ||
jachLog.LogInfo('Scanning input files...'); | ||
Sleep(500); | ||
jachLog.LogInfo('Consolidating information...'); | ||
Sleep(987); | ||
jachLog.LogInfo('Connecting to database...'); | ||
Sleep(312); | ||
jachLog.LogInfo('Updating information...'); | ||
Sleep(68); | ||
jachLog.LogInfo('Consuming webservice to report completion of the process...'); | ||
Sleep(142); | ||
jachLog.LogInfo('Process finished succesfully'); | ||
jachLog.DecIndent; | ||
jachLog.LogInfo('Program ended'); | ||
Writeln('Press any key to exit.'); | ||
Readln; | ||
except | ||
on E: Exception do | ||
jachLog.LogError(E); | ||
end; | ||
end. |
Oops, something went wrong.