You are not logged in.
Pages: 1
Hi Arnaud i have a may be stupid question how to handle your Change in TSynLog.DoLog/Enter in our Programs
you changed one Parameter from RawUtf8 to PUtf8Char
what is the best way to fix the Compiler Errors:
Sample 1:
old:
var XYZ: String := 'test'; // Sometimes we got String Var
TSynLog.Enter(StringToUtf8(XYZ), ...);
new:
TSynLog.Enter(PUtf8Char(StringToUtf8(XYZ)), ...); // is this the best way ?
Im not sure what this cast really does
Rad Studio 12.3 Athens
Offline
The best way is not to use TSynLog.Enter(...
Instead use:
var
aLog: ISynLog;
begin
aLog:= TSynLog.Enter(Self); //this is the first line before any other log
aLog.Log(sslInfo, ...
Offline
TY Daniel, this makes sense if you like to add something else to the Log.
My Question was concerning the Use of the Cast to PUtf8Char
Rad Studio 12.3 Athens
Offline
My Question was concerning the Use of the Cast to PUtf8Char
Defined as: "class function TSynLog.Enter(const TextFmt: RawUtf8; ...", then "TSynLog.Enter(StringToUtf8(XYZ), ...".
Defined as: "class function TSynLog.Enter(const TextFmt: PUtf8Char; ...", then "TSynLog.Enter(PUtf8Char(StringToUtf8(XYZ)), ..." or "TSynLog.Enter(Pointer(StringToUtf8(XYZ)), ...".
With best regards
Thomas
Last edited by tbo (Today 11:30:19)
Offline
Pages: 1