You've already forked lazarus-ccr
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3967 8e941d3f-bd1b-0410-a28a-d453659cc2b4
45 lines
753 B
ObjectPascal
45 lines
753 B
ObjectPascal
unit cconvlog;
|
|
|
|
interface
|
|
|
|
{$ifdef fpc}{$mode delphi}{$endif}
|
|
|
|
uses
|
|
SysUtils;
|
|
|
|
|
|
procedure log(const s: string); overload;
|
|
procedure log(const fmt: string; const params: array of const); overload;
|
|
|
|
var
|
|
_log : procedure (const s: string) = nil;
|
|
|
|
procedure _stdOutLog(const s: string);
|
|
procedure _stdErrLog(const s: string);
|
|
|
|
implementation
|
|
|
|
procedure _stdErrLog(const s: string);
|
|
begin
|
|
writeln(StdErr, s);
|
|
end;
|
|
|
|
procedure _stdOutLog(const s: string);
|
|
begin
|
|
writeln(s);
|
|
end;
|
|
|
|
procedure log(const s: string); overload;
|
|
begin
|
|
if Assigned(_log) then _log(s);
|
|
end;
|
|
|
|
procedure log(const fmt: string; const params: array of const); overload;
|
|
begin
|
|
if not assigned(_log) then Exit;
|
|
if fmt<>'' then Log(Format(fmt, params)) else Log('');
|
|
end;
|
|
|
|
end.
|
|
|