Final FPC мукышщт
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -75,7 +75,9 @@ backup/
|
|||||||
*.ppu
|
*.ppu
|
||||||
*.o
|
*.o
|
||||||
*.or
|
*.or
|
||||||
FPCTests/*.ico
|
FPCTest/*.ico
|
||||||
|
FPCTest/test.log
|
||||||
|
FPCTest/test2.log
|
||||||
*.ini
|
*.ini
|
||||||
|
|
||||||
Tests/Win32
|
Tests/Win32
|
||||||
46
AG.Logs.pas
46
AG.Logs.pas
@@ -2,6 +2,10 @@ unit AG.Logs;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$UNDEF MSWINDOWS}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF MSWINDOWS}{$IFDEF FPC}Windows{$ELSE}Winapi.Windows{$ENDIF},{$ENDIF}
|
{$IFDEF MSWINDOWS}{$IFDEF FPC}Windows{$ELSE}Winapi.Windows{$ENDIF},{$ENDIF}
|
||||||
{$IFDEF FPC}FGL{$ELSE}System.Generics.Collections{$ENDIF},
|
{$IFDEF FPC}FGL{$ELSE}System.Generics.Collections{$ENDIF},
|
||||||
@@ -9,9 +13,7 @@ uses
|
|||||||
{$IFDEF FPC}Classes{$ELSE}System.Classes{$ENDIF},
|
{$IFDEF FPC}Classes{$ELSE}System.Classes{$ENDIF},
|
||||||
{$IFDEF FPC}DateUtils{$ELSE}System.DateUtils{$ENDIF},
|
{$IFDEF FPC}DateUtils{$ELSE}System.DateUtils{$ENDIF},
|
||||||
{$IFDEF FPC}SyncObjs{$ELSE}System.SyncObjs{$ENDIF}
|
{$IFDEF FPC}SyncObjs{$ELSE}System.SyncObjs{$ENDIF}
|
||||||
{$IFNDEF MSWINDOWS},
|
{$IFNDEF MSWINDOWS}{$IFNDEF FPC},System.IOUtils{$ENDIF}{$ENDIF};
|
||||||
{$IFNDEF FPC}System.IOUtils{$ENDIF}
|
|
||||||
{$ENDIF};
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TAGLog=class abstract
|
TAGLog=class abstract
|
||||||
@@ -40,7 +42,7 @@ type
|
|||||||
TAGDiskLog=class(TAGLog)
|
TAGDiskLog=class(TAGLog)
|
||||||
strict protected
|
strict protected
|
||||||
{$IFNDEF MSWINDOWS}
|
{$IFNDEF MSWINDOWS}
|
||||||
Stream:TStream;
|
Stream:TFileStream;//TStream;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
buf1:WideString;
|
buf1:WideString;
|
||||||
onbuf:boolean;
|
onbuf:boolean;
|
||||||
@@ -106,6 +108,9 @@ type
|
|||||||
destructor Destroy();overload;override;
|
destructor Destroy();overload;override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
const
|
||||||
|
CharSize=SizeOf(char);//{$IFDEF FPC}1{$ELSE}2{$ENDIF};
|
||||||
|
|
||||||
Implementation
|
Implementation
|
||||||
|
|
||||||
constructor TAGLog.Create();
|
constructor TAGLog.Create();
|
||||||
@@ -191,13 +196,26 @@ ThreadHandle:=CreateThread(nil,0,{$IFDEF FPC}Self.MethodAddress('Init'){$ELSE}ad
|
|||||||
var
|
var
|
||||||
s:TBytes;
|
s:TBytes;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF FPC}
|
||||||
|
Stream:=nil;
|
||||||
|
try
|
||||||
|
Stream:=TFileStream.Create('test2.log',fmOpenRead);
|
||||||
|
SetLength(s,Stream.Size);
|
||||||
|
Stream.Read(s[0],Stream.Size);
|
||||||
|
except
|
||||||
|
SetLength(s,0);
|
||||||
|
end;
|
||||||
|
FreeAndNil(Stream);
|
||||||
|
{$ELSE}
|
||||||
try
|
try
|
||||||
s:=TFile.ReadAllBytes(FileName);
|
s:=TFile.ReadAllBytes(FileName);
|
||||||
except
|
except
|
||||||
s:=TBytes.Create();
|
s:=TBytes.Create();
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF}
|
||||||
Stream:=TFileStream.Create(FileName,fmCreate+fmOpenReadWrite+fmShareDenyWrite);
|
Stream:=TFileStream.Create(FileName,fmCreate+fmOpenReadWrite+fmShareDenyWrite);
|
||||||
Stream.WriteBuffer(s,length(s));
|
Stream.WriteBuffer(s[0],length(s));
|
||||||
|
SetLength(s,0);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
inherited Create;
|
inherited Create;
|
||||||
end;
|
end;
|
||||||
@@ -206,16 +224,16 @@ end;
|
|||||||
procedure TAGDiskLog.Init();stdcall;
|
procedure TAGDiskLog.Init();stdcall;
|
||||||
var
|
var
|
||||||
n:cardinal;
|
n:cardinal;
|
||||||
buf:PWideChar;
|
buf:PChar;
|
||||||
begin
|
begin
|
||||||
buf:='';
|
buf:='';
|
||||||
while Lock<>nil do
|
while Lock<>nil do
|
||||||
begin
|
begin
|
||||||
Lock.Enter;
|
Lock.Enter;
|
||||||
if buf<>'' then
|
if buf<>'' then
|
||||||
WriteFile(LogHandle,buf^,2*n,n,nil);
|
WriteFile(LogHandle,buf^,CharSize*n,n,nil);
|
||||||
n:=Length(buf1);
|
n:=Length(buf1);
|
||||||
buf:=Pwidechar(Copy(buf1,0,n));
|
buf:=PChar(Copy(buf1,0,n));
|
||||||
buf1:='';
|
buf1:='';
|
||||||
Lock.Leave;
|
Lock.Leave;
|
||||||
if WantTerminate then
|
if WantTerminate then
|
||||||
@@ -223,9 +241,9 @@ begin
|
|||||||
Sleep(0);
|
Sleep(0);
|
||||||
Lock.Enter;
|
Lock.Enter;
|
||||||
if buf<>'' then
|
if buf<>'' then
|
||||||
WriteFile(LogHandle,buf^,2*n,n,nil);
|
WriteFile(LogHandle,buf^,CharSize*n,n,nil);
|
||||||
n:=Length(buf1);
|
n:=Length(buf1);
|
||||||
buf:=Pwidechar(Copy(buf1,0,n));
|
buf:=PChar(Copy(buf1,0,n));
|
||||||
buf1:='';
|
buf1:='';
|
||||||
Lock.Leave;
|
Lock.Leave;
|
||||||
WantTerminate:=False;
|
WantTerminate:=False;
|
||||||
@@ -247,7 +265,11 @@ var
|
|||||||
s:string;
|
s:string;
|
||||||
begin
|
begin
|
||||||
s:=GenerateLogString(tabstr+text,o);
|
s:=GenerateLogString(tabstr+text,o);
|
||||||
Stream.WriteData(PWideChar(s),Length(s)*2);
|
{$IFDEF FPC}
|
||||||
|
Stream.Write(PChar(s)^,Length(s)*CharSize);
|
||||||
|
{$ELSE}
|
||||||
|
Stream.WriteData(PChar(s),Length(s)*CharSize);
|
||||||
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -322,7 +344,7 @@ var
|
|||||||
s:string;
|
s:string;
|
||||||
begin
|
begin
|
||||||
s:=GenerateLogString(Text,o);
|
s:=GenerateLogString(Text,o);
|
||||||
stream.Write(PWideChar(s)^,2*length(s));
|
stream.Write(PChar(s)^,CharSize*length(s));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{TAGCallBackLog}
|
{TAGCallBackLog}
|
||||||
|
|||||||
@@ -10,9 +10,6 @@
|
|||||||
<UseAppBundle Value="False"/>
|
<UseAppBundle Value="False"/>
|
||||||
<ResourceType Value="res"/>
|
<ResourceType Value="res"/>
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
|
||||||
<StringTable ProductVersion=""/>
|
|
||||||
</VersionInfo>
|
|
||||||
<BuildModes Count="1">
|
<BuildModes Count="1">
|
||||||
<Item1 Name="Default" Default="True"/>
|
<Item1 Name="Default" Default="True"/>
|
||||||
</BuildModes>
|
</BuildModes>
|
||||||
@@ -22,6 +19,7 @@
|
|||||||
<RunParams>
|
<RunParams>
|
||||||
<local>
|
<local>
|
||||||
<FormatVersion Value="1"/>
|
<FormatVersion Value="1"/>
|
||||||
|
<CommandLineParams Value="-a"/>
|
||||||
</local>
|
</local>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
<RequiredPackages Count="1">
|
<RequiredPackages Count="1">
|
||||||
@@ -57,11 +55,18 @@
|
|||||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
<CodeGeneration>
|
<CodeGeneration>
|
||||||
<TargetCPU Value="jvm"/>
|
<Optimizations>
|
||||||
|
<OptimizationLevel Value="0"/>
|
||||||
|
</Optimizations>
|
||||||
</CodeGeneration>
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseValgrind Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
<Debugging>
|
<Debugging>
|
||||||
<Exceptions Count="3">
|
<Exceptions Count="4">
|
||||||
<Item1>
|
<Item1>
|
||||||
<Name Value="EAbort"/>
|
<Name Value="EAbort"/>
|
||||||
</Item1>
|
</Item1>
|
||||||
@@ -71,6 +76,9 @@
|
|||||||
<Item3>
|
<Item3>
|
||||||
<Name Value="EFOpenError"/>
|
<Name Value="EFOpenError"/>
|
||||||
</Item3>
|
</Item3>
|
||||||
|
<Item4>
|
||||||
|
<Name Value="EReadError"/>
|
||||||
|
</Item4>
|
||||||
</Exceptions>
|
</Exceptions>
|
||||||
</Debugging>
|
</Debugging>
|
||||||
</CONFIG>
|
</CONFIG>
|
||||||
|
|||||||
@@ -4,22 +4,21 @@
|
|||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="10"/>
|
<Version Value="10"/>
|
||||||
<BuildModes Active="Default"/>
|
<BuildModes Active="Default"/>
|
||||||
<Units Count="6">
|
<Units Count="4">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="fpcunitproject1.lpr"/>
|
<Filename Value="fpcunitproject1.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<WindowIndex Value="-1"/>
|
<CursorPos X="44" Y="21"/>
|
||||||
<TopLine Value="-1"/>
|
<UsageCount Value="192"/>
|
||||||
<CursorPos X="-1" Y="-1"/>
|
|
||||||
<UsageCount Value="20"/>
|
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="testcase1.pas"/>
|
<Filename Value="testcase1.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="TestCase1"/>
|
<UnitName Value="TestCase1"/>
|
||||||
<CursorPos X="98" Y="24"/>
|
<TopLine Value="21"/>
|
||||||
<UsageCount Value="20"/>
|
<CursorPos Y="42"/>
|
||||||
|
<UsageCount Value="192"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
@@ -27,64 +26,149 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="1"/>
|
||||||
<CursorPos X="89" Y="25"/>
|
<CursorPos X="3" Y="6"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="192"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\win\wininc\redef.inc"/>
|
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\objpas\sysutils\sysutilh.inc"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="14"/>
|
<TopLine Value="282"/>
|
||||||
<CursorPos X="29" Y="30"/>
|
<CursorPos X="17" Y="320"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="4"/>
|
||||||
</Unit3>
|
</Unit3>
|
||||||
<Unit4>
|
|
||||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\win\wininc\base.inc"/>
|
|
||||||
<EditorIndex Value="-1"/>
|
|
||||||
<TopLine Value="636"/>
|
|
||||||
<CursorPos X="6" Y="652"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
</Unit4>
|
|
||||||
<Unit5>
|
|
||||||
<Filename Value="C:\lazarus\packager\registration\fcllaz.pas"/>
|
|
||||||
<EditorIndex Value="-1"/>
|
|
||||||
<CursorPos X="3" Y="11"/>
|
|
||||||
<UsageCount Value="10"/>
|
|
||||||
</Unit5>
|
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="8" HistoryIndex="7">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="testcase1.pas"/>
|
<Filename Value="testcase1.pas"/>
|
||||||
<Caret Line="31" Column="6" TopLine="15"/>
|
<Caret Line="41" TopLine="21"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="testcase1.pas"/>
|
<Filename Value="testcase1.pas"/>
|
||||||
<Caret Line="31" Column="6" TopLine="15"/>
|
<Caret Line="42" TopLine="21"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="testcase1.pas"/>
|
<Filename Value="testcase1.pas"/>
|
||||||
<Caret Line="33" Column="20" TopLine="17"/>
|
<Caret Line="43" TopLine="21"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="..\AG.Logs.pas"/>
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
<Caret Line="25" Column="89"/>
|
<Caret Line="402" TopLine="381"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="testcase1.pas"/>
|
<Filename Value="testcase1.pas"/>
|
||||||
<Caret Line="31" Column="5" TopLine="15"/>
|
<Caret Line="34" Column="37" TopLine="27"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="testcase1.pas"/>
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
<Caret Line="38" Column="2" TopLine="21"/>
|
<Caret Line="292" TopLine="278"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="testcase1.pas"/>
|
<Filename Value="testcase1.pas"/>
|
||||||
<Caret Line="12" Column="50"/>
|
<Caret Line="39" TopLine="27"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="testcase1.pas"/>
|
<Filename Value="testcase1.pas"/>
|
||||||
<Caret Line="24" Column="98"/>
|
<Caret Line="40" TopLine="27"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
|
<Position9>
|
||||||
|
<Filename Value="testcase1.pas"/>
|
||||||
|
<Caret Line="41" TopLine="27"/>
|
||||||
|
</Position9>
|
||||||
|
<Position10>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="402" TopLine="381"/>
|
||||||
|
</Position10>
|
||||||
|
<Position11>
|
||||||
|
<Filename Value="testcase1.pas"/>
|
||||||
|
<Caret Line="28" Column="85" TopLine="27"/>
|
||||||
|
</Position11>
|
||||||
|
<Position12>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="292" TopLine="278"/>
|
||||||
|
</Position12>
|
||||||
|
<Position13>
|
||||||
|
<Filename Value="testcase1.pas"/>
|
||||||
|
<Caret Line="39" TopLine="27"/>
|
||||||
|
</Position13>
|
||||||
|
<Position14>
|
||||||
|
<Filename Value="testcase1.pas"/>
|
||||||
|
<Caret Line="40" TopLine="27"/>
|
||||||
|
</Position14>
|
||||||
|
<Position15>
|
||||||
|
<Filename Value="testcase1.pas"/>
|
||||||
|
<Caret Line="41" TopLine="27"/>
|
||||||
|
</Position15>
|
||||||
|
<Position16>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="402" TopLine="381"/>
|
||||||
|
</Position16>
|
||||||
|
<Position17>
|
||||||
|
<Filename Value="testcase1.pas"/>
|
||||||
|
<Caret Line="37" Column="31" TopLine="27"/>
|
||||||
|
</Position17>
|
||||||
|
<Position18>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="292" TopLine="278"/>
|
||||||
|
</Position18>
|
||||||
|
<Position19>
|
||||||
|
<Filename Value="testcase1.pas"/>
|
||||||
|
<Caret Line="39" TopLine="27"/>
|
||||||
|
</Position19>
|
||||||
|
<Position20>
|
||||||
|
<Filename Value="testcase1.pas"/>
|
||||||
|
<Caret Line="40" TopLine="27"/>
|
||||||
|
</Position20>
|
||||||
|
<Position21>
|
||||||
|
<Filename Value="testcase1.pas"/>
|
||||||
|
<Caret Line="41" TopLine="27"/>
|
||||||
|
</Position21>
|
||||||
|
<Position22>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="402" TopLine="381"/>
|
||||||
|
</Position22>
|
||||||
|
<Position23>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="212" Column="33" TopLine="196"/>
|
||||||
|
</Position23>
|
||||||
|
<Position24>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="216" TopLine="196"/>
|
||||||
|
</Position24>
|
||||||
|
<Position25>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="217" TopLine="196"/>
|
||||||
|
</Position25>
|
||||||
|
<Position26>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="390" Column="79" TopLine="381"/>
|
||||||
|
</Position26>
|
||||||
|
<Position27>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="216" TopLine="203"/>
|
||||||
|
</Position27>
|
||||||
|
<Position28>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="217" TopLine="203"/>
|
||||||
|
</Position28>
|
||||||
|
<Position29>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="390" Column="81" TopLine="381"/>
|
||||||
|
</Position29>
|
||||||
|
<Position30>
|
||||||
|
<Filename Value="..\AG.Logs.pas"/>
|
||||||
|
<Caret Line="217" TopLine="203"/>
|
||||||
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectSession>
|
</ProjectSession>
|
||||||
|
<Debugging>
|
||||||
|
<BreakPoints Count="1">
|
||||||
|
<Item1>
|
||||||
|
<Kind Value="bpkAddress"/>
|
||||||
|
<Address Value="168437"/>
|
||||||
|
<WatchScope Value="wpsLocal"/>
|
||||||
|
<WatchKind Value="wpkWrite"/>
|
||||||
|
</Item1>
|
||||||
|
</BreakPoints>
|
||||||
|
</Debugging>
|
||||||
</CONFIG>
|
</CONFIG>
|
||||||
|
|||||||
@@ -27,14 +27,19 @@ MultiLog:=TAGMultiLog.Create(nil);
|
|||||||
(MultiLog as TAGMultiLog).Logs.Add(TAGDiskLog.Create('test.log'));
|
(MultiLog as TAGMultiLog).Logs.Add(TAGDiskLog.Create('test.log'));
|
||||||
(MultiLog as TAGMultiLog).Logs.Add(TAGRamLog.Create());
|
(MultiLog as TAGMultiLog).Logs.Add(TAGRamLog.Create());
|
||||||
{$IFNDEF MSWINDOWS}(MultiLog as TAGMultiLog).Logs.Add(TAGCommandLineLog.Create(GetStdHandle(STD_OUTPUT_HANDLE))){$ENDIF};
|
{$IFNDEF MSWINDOWS}(MultiLog as TAGMultiLog).Logs.Add(TAGCommandLineLog.Create(GetStdHandle(STD_OUTPUT_HANDLE))){$ENDIF};
|
||||||
|
Stream:=nil;
|
||||||
try
|
try
|
||||||
//s:=TFile.ReadAllBytes('test2.log');
|
Stream:=TFileStream.Create('test2.log',fmOpenRead);
|
||||||
|
SetLength(s,Stream.Size);
|
||||||
|
Stream.Read(s[0],Stream.Size);
|
||||||
except
|
except
|
||||||
//s:=TBytes.Create();
|
SetLength(s,0);
|
||||||
end;
|
end;
|
||||||
|
FreeAndNil(Stream);
|
||||||
Stream:=TFileStream.Create('test2.log',fmCreate+fmOpenReadWrite+fmShareDenyWrite);
|
Stream:=TFileStream.Create('test2.log',fmCreate+fmOpenReadWrite+fmShareDenyWrite);
|
||||||
Stream.WriteBuffer(s,length(s));
|
Stream.Write(s[0],Length(s));
|
||||||
(MultiLog as TAGMultiLog).Logs.Add(TAGStreamLog.Create(Stream));
|
(MultiLog as TAGMultiLog).Logs.Add(TAGStreamLog.Create(Stream));
|
||||||
|
SetLength(s,0);
|
||||||
{(MultiLog as TAGMultiLog).Logs.Add(TAGCallBackLog.Create(procedure(s:string)
|
{(MultiLog as TAGMultiLog).Logs.Add(TAGCallBackLog.Create(procedure(s:string)
|
||||||
begin
|
begin
|
||||||
Self.WriteLn(s);
|
Self.WriteLn(s);
|
||||||
|
|||||||
Reference in New Issue
Block a user