-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix not showing early logged messages in the UI (#1712)
* Buffer log events before a receiver is set, fixes #1702 * Always set a receiver if an unchecked exception was thrown when running chunky
- Loading branch information
1 parent
704cab0
commit 2e2e884
Showing
4 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package se.llbit.log; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class BufferingConsoleReceiver extends Receiver { | ||
public static final BufferingConsoleReceiver INSTANCE = new BufferingConsoleReceiver(); | ||
|
||
private final List<Event> bufferedEvents = new ArrayList<>(); | ||
|
||
protected BufferingConsoleReceiver() { | ||
} | ||
|
||
@Override | ||
public void logEvent(Level level, String message) { | ||
this.bufferedEvents.add(new Event(level, message)); | ||
} | ||
|
||
@Override | ||
public boolean isBuffered() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public List<Event> getBufferedEvents() { | ||
return this.bufferedEvents; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters