-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdebugu.pas
79 lines (63 loc) · 1.34 KB
/
debugu.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
unit DebugU;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, lclversion, dbugintf;
procedure infoEx(L,M:String; MType: TDebugLevel);
procedure info(L:String;M:String='');
procedure info(L:String;I:integer);
procedure info(L:String;b:boolean);
procedure info(L:String;SL:Tstrings);
procedure info(L:String;P:TPoint);
procedure infoErr(L:String;M:String='');
implementation
procedure infoEx(L,M:String; MType: TDebugLevel);
begin
{$IFDEF DEBUG}
SendDebugFmtEx('%s: %s',[L,M],MType);
{$ENDIF}
end;
procedure info(L,M:String);
begin
{$IFDEF DEBUG}
SendDebugFmt('%s: %s',[L,M]);
{$ENDIF}
end;
procedure info(L:string; I: integer);
begin
{$IFDEF DEBUG}
info(L,inttostr(i));
{$ENDIF}
end;
procedure info(L:string;b: boolean);
begin
{$IFDEF DEBUG}
if b then info(L,'true') else info(L,'false');
{$ENDIF}
end;
procedure info(L:String;SL: TStrings);
var s:string;
begin
{$IFDEF DEBUG}
SendSeparator;
info(L,'Start of list: ');
for s in SL do info('',s);
info(L,'End of list');
SendSeparator;
{$ENDIF}
end;
procedure info(L: String; P: TPoint);
begin
{$IFDEF DEBUG}
info(L,' X='+inttostr(P.x)+' Y='+inttostr(P.y));
{$ENDIF}
end;
procedure infoErr(L: String; M: String);
begin
{$IFDEF DEBUG}
SendDebugFmtEx('%s: %s',[L,M],dlError);
{$ENDIF}
end;
initialization
info('LCLFullVersion',lcl_fullversion);
end.