Skip to content

Commit 0e7b920

Browse files
committed
Basic console demo added
1 parent 45a3e8d commit 0e7b920

File tree

3 files changed

+693
-0
lines changed

3 files changed

+693
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
program BasicConsoleDemo;
2+
3+
{$APPTYPE CONSOLE}
4+
5+
{$R *.res}
6+
7+
uses
8+
System.SysUtils,
9+
ujachLogAuto in '..\..\src\ujachLogAuto.pas',
10+
UjachLogMgr in '..\..\src\UjachLogMgr.pas';
11+
12+
begin
13+
try
14+
jachLog.LogInfo('Program started');
15+
jachLog.IncIndent;
16+
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, '
17+
+ 'the same log will be printed to console and writed to a disk file that will preserve the output'#13
18+
+ 'To make the example look like a real process, we will add some entries to the log that simulates a real processing'
19+
);
20+
jachLog.LogInfo('Scanning input files...');
21+
Sleep(500);
22+
jachLog.LogInfo('Consolidating information...');
23+
Sleep(987);
24+
jachLog.LogInfo('Connecting to database...');
25+
Sleep(312);
26+
jachLog.LogInfo('Updating information...');
27+
Sleep(68);
28+
jachLog.LogInfo('Consuming webservice to report completion of the process...');
29+
Sleep(142);
30+
jachLog.LogInfo('Process finished succesfully');
31+
jachLog.DecIndent;
32+
jachLog.LogInfo('Program ended');
33+
Writeln('Press any key to exit.');
34+
Readln;
35+
except
36+
on E: Exception do
37+
jachLog.LogError(E);
38+
end;
39+
end.

0 commit comments

Comments
 (0)