mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-16 16:25:54 +01:00
40 lines
856 B
ObjectPascal
40 lines
856 B
ObjectPascal
|
unit LoggerPro.DBAppender.FireDAC;
|
||
|
|
||
|
// DB log appender for FireDAC
|
||
|
|
||
|
interface
|
||
|
|
||
|
uses
|
||
|
System.Classes,
|
||
|
LoggerPro, System.SysUtils, Data.DB,
|
||
|
LoggerPro.DBAppender,
|
||
|
FireDAC.Stan.Error,
|
||
|
FireDAC.DApt,
|
||
|
FireDAC.Phys,
|
||
|
FireDAC.Stan.Param,
|
||
|
FireDAC.Comp.Client;
|
||
|
|
||
|
type
|
||
|
/// <summary>LoggerPro that persists to DB via a FireDAC stored procedure</summary>
|
||
|
TLoggerProDBAppenderFireDAC = class(TLoggerProDBAppender<TFDStoredProc>)
|
||
|
protected
|
||
|
procedure RefreshParams(DataObj: TFDStoredProc); override;
|
||
|
procedure ExecuteDataObject(DataObj: TFDStoredProc); override;
|
||
|
end;
|
||
|
|
||
|
implementation
|
||
|
|
||
|
{ TLoggerProDBAppenderFireDAC }
|
||
|
|
||
|
procedure TLoggerProDBAppenderFireDAC.ExecuteDataObject(DataObj: TFDStoredProc);
|
||
|
begin
|
||
|
DataObj.ExecProc;
|
||
|
end;
|
||
|
|
||
|
procedure TLoggerProDBAppenderFireDAC.RefreshParams(DataObj: TFDStoredProc);
|
||
|
begin
|
||
|
DataObj.Prepare;
|
||
|
end;
|
||
|
|
||
|
end.
|