Browse Source

HIGHLOG fixed bugs

PascalCoin 3 years ago
parent
commit
d588459c74
3 changed files with 10 additions and 8 deletions
  1. 5 5
      src/core/UAccounts.pas
  2. 1 1
      src/core/ULog.pas
  3. 4 2
      src/core/UPCTemporalAbstractMem.pas

+ 5 - 5
src/core/UAccounts.pas

@@ -4916,11 +4916,11 @@ begin
 
         If (iDeleted<0) then begin
           If (iAdded<0) then begin
-            {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,ClassName,Format('Deleted from PREVIOUS snapshot name:%s at account:%d',[blockAccount.accounts[iAccount].name,account_number]));{$ENDIF}
+            {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,ClassName,Format('Deleted from PREVIOUS snapshot name:%s at account:%d',[blockAccount.accounts[iAccount].name.ToPrintable,account_number]));{$ENDIF}
             FDeletedNamesSincePreviousSafebox.Add(blockAccount.accounts[iAccount].name,account_number); // Very important to store account_number in order to restore a snapshot!
           end else begin
             // Was added, so delete from added
-            {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,ClassName,Format('Deleted from current snapshot name:%s at account:%d',[blockAccount.accounts[iAccount].name,account_number]));{$ENDIF}
+            {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,ClassName,Format('Deleted from current snapshot name:%s at account:%d',[blockAccount.accounts[iAccount].name.ToPrintable,account_number]));{$ENDIF}
             FAddedNamesSincePreviousSafebox.Delete(iAdded);
           end;
         end else begin
@@ -4951,17 +4951,17 @@ begin
         If (iDeleted>=0) Then begin
           if (FDeletedNamesSincePreviousSafebox.GetTag(iDeleted)=account_number) then begin
             // Is restoring to initial position, delete from deleted
-            {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,ClassName,Format('Adding equal to PREVIOUS (DELETING FROM DELETED) snapshot name:%s at account:%d',[blockAccount.accounts[iAccount].name,account_number]));{$ENDIF}
+            {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,ClassName,Format('Adding equal to PREVIOUS (DELETING FROM DELETED) snapshot name:%s at account:%d',[blockAccount.accounts[iAccount].name.ToPrintable,account_number]));{$ENDIF}
             FDeletedNamesSincePreviousSafebox.Delete(iDeleted);
             if iAdded>=0 then FAddedNamesSincePreviousSafebox.Remove(blockAccount.accounts[iAccount].name);
           end else begin
             // Was deleted, but now adding to a new account
-            {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,ClassName,Format('Adding again name:%s to new account account:%d',[blockAccount.accounts[iAccount].name,account_number]));{$ENDIF}
+            {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,ClassName,Format('Adding again name:%s to new account account:%d',[blockAccount.accounts[iAccount].name.ToPrintable,account_number]));{$ENDIF}
             FAddedNamesSincePreviousSafebox.Add(blockAccount.accounts[iAccount].name,account_number);
           end;
         end else begin
           // Was not deleted, Add it
-          {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,ClassName,Format('Adding first time at this snapshot name:%s at account:%d',[blockAccount.accounts[iAccount].name,account_number]));{$ENDIF}
+          {$IFDEF HIGHLOG}TLog.NewLog(ltdebug,ClassName,Format('Adding first time at this snapshot name:%s at account:%d',[blockAccount.accounts[iAccount].name.ToPrintable,account_number]));{$ENDIF}
           FAddedNamesSincePreviousSafebox.Add(blockAccount.accounts[iAccount].name,account_number);
         end;
       end;

+ 1 - 1
src/core/ULog.pas

@@ -166,7 +166,7 @@ begin
   try
     if assigned(FFileStream) And (logType in FSaveTypes) then begin
       if TThread.CurrentThread.ThreadID=MainThreadID then tid := ' MAIN:' else tid:=' TID:';
-      s := FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz',now)+tid+IntToHex(PtrInt(TThread.CurrentThread.ThreadID),8)+' ['+CT_LogType[logtype]+'] <'+sender+'> '+logtext+#13#10;
+      s := FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz',now)+tid+PtrInt(TThread.CurrentThread.ThreadID).ToHexString+' ['+CT_LogType[logtype]+'] <'+sender+'> '+logtext+#13#10;
       FFileStream.Write(s[Low(s)],Length(s));
     end;
     if Assigned(FOnInThreadNewLog) then begin

+ 4 - 2
src/core/UPCTemporalAbstractMem.pas

@@ -61,9 +61,11 @@ begin
 end;
 
 destructor TPCTemporalAbstractMem.Destroy;
-{$IFDEF HIGHLOG}var LSize : Integer;{$ENDIF}
+{$IFDEF HIGHLOG}var LSize : Int64;{$ENDIF}
 begin
-  {$IFDEF HIGHLOG}LSize := Size;{$ENDIF}
+  {$IFDEF HIGHLOG}
+  LSize := {$IFDEF USE_ABSTRACTMEM}NextAvailablePos{$ELSE}Size{$ENDIF};
+  {$ENDIF}
   inherited Destroy;
   {$IFDEF USE_ABSTRACTMEM}
   if FTemporalFileName<>'' then begin