Skip to content
Permalink
Browse files

introduce TSynLog.ForceRotation method

  • Loading branch information...
pavel.mash
pavel.mash committed Jul 26, 2019
1 parent 653cfcc commit b4a6d1b9423f2c77cc1ab8bed4b6a0994d743c84
Showing with 12 additions and 0 deletions.
  1. +12 −0 SynLog.pas
@@ -1075,6 +1075,8 @@ TSynLog = class(TObject, ISynLog)
procedure DisableRemoteLog(value: boolean);
/// the associated TSynLog class
function LogClass: TSynLogClass; {$ifdef HASINLINENOTX86}inline;{$endif}
/// Force log rotation; Can be used for example inside SUGHUP signal handler
procedure ForceRotation;
/// direct access to the low-level writing content
// - should usually not be used directly, unless you ensure it is safe
property Writer: TTextWriter read fWriter;
@@ -4185,6 +4187,16 @@ function TSynLog.LogClass: TSynLogClass;
result := PPointer(self)^;
end;

procedure TSynLog.ForceRotation;
begin
EnterCriticalSection(GlobalThreadLock);
try
PerformRotation;
finally
LeaveCriticalSection(GlobalThreadLock);
end;
end;

procedure TSynLog.DisableRemoteLog(value: boolean);
begin
if (fDisableRemoteLog=value) or not Assigned(fFamily.fEchoRemoteEvent) then

0 comments on commit b4a6d1b

Please sign in to comment.
You can’t perform that action at this time.