Skip to content

Commit

Permalink
Basic console demo added
Browse files Browse the repository at this point in the history
  • Loading branch information
jachguate committed Feb 21, 2022
1 parent 45a3e8d commit 0e7b920
Show file tree
Hide file tree
Showing 3 changed files with 693 additions and 0 deletions.
39 changes: 39 additions & 0 deletions demos/BasicConsole/BasicConsoleDemo.dpr
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.
Loading

0 comments on commit 0e7b920

Please sign in to comment.