Package org.emrick.project.dev
Class AppLog
java.lang.Object
org.emrick.project.dev.AppLog
Keeps a copy of everything Emrick Designer prints to System.out / System.err since launch, so the
Developer Mode terminal can show it. Output still goes to the console as before. Kept in memory
only (bounded), never written to disk unless the user saves it from the terminal.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne captured line of output.private static classPasses bytes through to the original stream and collects them into lines for the log. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Deque<AppLog.Entry>private static booleanprivate static final List<Consumer<AppLog.Entry>>private static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddListener(Consumer<AppLog.Entry> listener) private static voidstatic voidinstall()Starts capturing.static voidremoveListener(Consumer<AppLog.Entry> listener) static List<AppLog.Entry>snapshot()
-
Field Details
-
MAX_ENTRIES
private static final int MAX_ENTRIES- See Also:
-
entries
-
listeners
-
installed
private static boolean installed
-
-
Constructor Details
-
AppLog
private AppLog()
-
-
Method Details
-
install
public static void install()Starts capturing. Call once, as early as possible in main(). -
snapshot
- Returns:
- every line captured so far, oldest first
-
addListener
-
removeListener
-
append
-