mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-06 04:07:30 +01:00
* Implemented Pause/Resume, paused
git-svn-id: trunk@19630 -
This commit is contained in:
parent
3040d9746b
commit
7effdb1eaa
@ -44,6 +44,7 @@ Type
|
|||||||
FOnGetCustomCategory : TLogCategoryEvent;
|
FOnGetCustomCategory : TLogCategoryEvent;
|
||||||
FOnGetCustomEventID : TLogCodeEvent;
|
FOnGetCustomEventID : TLogCodeEvent;
|
||||||
FOnGetCustomEvent : TLogCodeEvent;
|
FOnGetCustomEvent : TLogCodeEvent;
|
||||||
|
FPaused : Boolean;
|
||||||
procedure SetActive(const Value: Boolean);
|
procedure SetActive(const Value: Boolean);
|
||||||
procedure SetIdentification(const Value: String);
|
procedure SetIdentification(const Value: String);
|
||||||
procedure SetlogType(const Value: TLogType);
|
procedure SetlogType(const Value: TLogType);
|
||||||
@ -72,6 +73,8 @@ Type
|
|||||||
Function EventTypeToString(E : TEventType) : String;
|
Function EventTypeToString(E : TEventType) : String;
|
||||||
Function RegisterMessageFile(AFileName : String) : Boolean; virtual;
|
Function RegisterMessageFile(AFileName : String) : Boolean; virtual;
|
||||||
Function UnRegisterMessageFile : Boolean; virtual;
|
Function UnRegisterMessageFile : Boolean; virtual;
|
||||||
|
Procedure Pause;
|
||||||
|
Procedure Resume;
|
||||||
Procedure Log (EventType : TEventType; const Msg : String); {$ifndef fpc }Overload;{$endif}
|
Procedure Log (EventType : TEventType; const Msg : String); {$ifndef fpc }Overload;{$endif}
|
||||||
Procedure Log (EventType : TEventType; const Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
|
Procedure Log (EventType : TEventType; const Fmt : String; Args : Array of const); {$ifndef fpc }Overload;{$endif}
|
||||||
Procedure Log (const Msg : String); {$ifndef fpc }Overload;{$endif}
|
Procedure Log (const Msg : String); {$ifndef fpc }Overload;{$endif}
|
||||||
@ -98,6 +101,7 @@ Type
|
|||||||
Property OnGetCustomCategory : TLogCategoryEvent Read FOnGetCustomCategory Write FOnGetCustomCategory;
|
Property OnGetCustomCategory : TLogCategoryEvent Read FOnGetCustomCategory Write FOnGetCustomCategory;
|
||||||
Property OnGetCustomEventID : TLogCodeEvent Read FOnGetCustomEventID Write FOnGetCustomEventID;
|
Property OnGetCustomEventID : TLogCodeEvent Read FOnGetCustomEventID Write FOnGetCustomEventID;
|
||||||
Property OnGetCustomEvent : TLogCodeEvent Read FOnGetCustomEvent Write FOnGetCustomEvent;
|
Property OnGetCustomEvent : TLogCodeEvent Read FOnGetCustomEvent Write FOnGetCustomEvent;
|
||||||
|
Property Paused : Boolean Read FPaused Write FPaused;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
ELogError = Class(Exception);
|
ELogError = Class(Exception);
|
||||||
@ -144,6 +148,20 @@ begin
|
|||||||
Active:=True;
|
Active:=True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Procedure TEventLog.Pause;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Paused:=True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Procedure TEventLog.Resume;
|
||||||
|
begin
|
||||||
|
Paused:=False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TEventLog.Error(const Fmt: String; Args: array of const);
|
procedure TEventLog.Error(const Fmt: String; Args: array of const);
|
||||||
begin
|
begin
|
||||||
Error(Format(Fmt,Args));
|
Error(Format(Fmt,Args));
|
||||||
@ -177,6 +195,8 @@ end;
|
|||||||
|
|
||||||
procedure TEventLog.Log(EventType: TEventType; const Msg: String);
|
procedure TEventLog.Log(EventType: TEventType; const Msg: String);
|
||||||
begin
|
begin
|
||||||
|
If Paused then
|
||||||
|
exit;
|
||||||
EnsureActive;
|
EnsureActive;
|
||||||
Case FlogType of
|
Case FlogType of
|
||||||
ltFile : WriteFileLog(EventType,Msg);
|
ltFile : WriteFileLog(EventType,Msg);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user