#1 2018-04-13 08:13:02

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

SynLog regression

@ab, there is regression in changed TSynLog.Log(TypeInfo()) to specify the value as const commit.
Now I can't compile code what use a call to Log with TextTruncateAtLength parameter

procedure Log(Level: TSynLogInfo; const Text: RawUTF8;
      Instance: TObject=nil; TextTruncateAtLength: integer=maxInt); overload;
// my code
  Ctxt.Log.Log(sllHTTP, Call.InBody, nil, 1024)

because it call match a

    procedure Log(Level: TSynLogInfo; const aName: RawUTF8;
      aTypeInfo: pointer; const aValue; Instance: TObject=nil); overload;

signature instead of version with TextTruncateAtLength ( FPC compiler)

Please, fix it in some way..

Online

#2 2018-04-13 11:42:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,669
Website

Re: SynLog regression

if you get rid of the last =nil parameter default value?

Offline

#3 2018-04-13 12:01:14

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: SynLog regression

Yes, if I remove default value in function below all work fine

procedure Log(Level: TSynLogInfo; const aName: RawUTF8;
      aTypeInfo: pointer; const aValue; Instance: TObject{=nil}); overload;

Online

#4 2018-04-13 12:42:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,669
Website

Re: SynLog regression

Offline

#5 2018-04-13 14:14:57

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: SynLog regression

Now work as expected (both linux & windows FPC 3.1.1). Thanks!

Last edited by mpv (2018-04-13 14:15:08)

Online

#6 2018-04-21 10:40:36

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: SynLog regression

Another regression with the similar reason. In case

constructor TSynMemoryStreamMapped.Create(const aFileName: TFileName;
  aCustomSize: cardinal; aCustomOffset: Int64);

called with one argument (aFileName) then actual stream is created using

constructor TSynMemoryStream.Create(const aText: RawByteString);

and content of a stream is a file name, instead of file content.

Possible fix is in pull 107 (verified with FPC)

Online

Board footer

Powered by FluxBB