Skip to content

Commit

Permalink
Merge pull request #4 from JTheiller/main
Browse files Browse the repository at this point in the history
fix: Loss of logs and content with data from the previous record
  • Loading branch information
viniciussanchez authored Jan 28, 2025
2 parents 86ffbd4 + 6f79ebc commit b506b50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Horse.Logger.Provider.Console.pas
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ procedure THorseLoggerProviderConsole.DoReceiveLogCache(ALogCache: THorseLoggerC
I: Integer;
begin
for I := 0 to Pred(ALogCache.Count) do
FHorseLoggerProviderConsoleManager.NewLog(THorseLoggerLog(ALogCache.Items[0].Clone));
FHorseLoggerProviderConsoleManager.NewLog(THorseLoggerLog(ALogCache.Items[I].Clone));
end;

class function THorseLoggerProviderConsole.New(const AConfig: THorseLoggerConsoleConfig = nil): IHorseLoggerProvider;
Expand Down Expand Up @@ -125,13 +125,13 @@ procedure THorseLoggerProviderConsoleManager.DispatchLogCache;
begin
if FConfig = nil then
FConfig := THorseLoggerConsoleConfig.New;
FConfig.GetLogFormat(LLogStr);
LLogCache := ExtractLogCache;
try
if LLogCache.Count = 0 then
Exit;
for I := 0 to Pred(LLogCache.Count) do
begin
LLogStr := FConfig.FLogFormat;
LLog := LLogCache.Items[I] as THorseLoggerLog;
LParams := THorseLoggerUtils.GetFormatParams(LLogStr);
for Z := Low(LParams) to High(LParams) do
Expand Down

0 comments on commit b506b50

Please sign in to comment.