Skip to content

Commit

Permalink
Applied fixes for Free Pascal and newer Delphi versions
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelJustin committed Jan 22, 2016
1 parent 11c1e1a commit 0987f31
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/Log4D.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interface
{$ELSE}
Windows,
{$ENDIF}
{$IFDEF DELPHI5_UP}
{$IFDEF HAS_UNIT_CONTNRS}
Contnrs,
{$ENDIF}
SysUtils;
Expand Down Expand Up @@ -1873,9 +1873,14 @@ procedure TLogRoot.SetLevel(const Level: TLogLevel);

{ Initialise internal logging - send it to debugging output. }
constructor TLogLog.Create;
// fix for Free Pascal by M Justin: use a variable
var
TmpAppender: ILogAppender;
begin
inherited Create('');
AddAppender(TLogODSAppender.Create(''));

TmpAppender := TLogODSAppender.Create('');
AddAppender(TmpAppender);
InternalDebugging := False;
Level := Log4D.Debug;
end;
Expand Down Expand Up @@ -2203,7 +2208,10 @@ function TLogCustomLayout.IgnoresException: Boolean;
procedure TLogCustomLayout.Init;
begin
inherited Init;
SetOption(DateFormatOpt, ShortDateFormat);
SetOption(DateFormatOpt,
{$IFDEF DELPHIXE_UP}FormatSettings.{$ENDIF}
{$IFDEF FPC}FormatSettings.{$ENDIF}
ShortDateFormat);
end;

{ Set a list of options for this layout. }
Expand Down

0 comments on commit 0987f31

Please sign in to comment.