Skip to content

Conversation

@Vzor-
Copy link
Contributor

@Vzor- Vzor- commented Nov 20, 2025

fixes #1384

This fixes

  • A log duplication bug cause by appending the entire log content to the window every time a new log was made.
  • Text areas are VERY expensive in swing, so we limit the content to n-lines

New features

  • Log colors!

todo:

  • make lines a field that can be set
  • I was also thinking of adding a 'scroll lock' checkbox
logs.mov

@tresf tresf changed the title LogDialog Bloat Fix LogDialog improvements Nov 25, 2025
@bratpeki bratpeki self-assigned this Nov 25, 2025

/**
* JTextPane only wraps on whitespace, and never breaks words, regardless of length.
* LineWrapTextPane breaks after a BREAK_PATTERN match, or breaks long strings if a valid
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what is the BREAK_PATTERN, exactly? I see that the LogDialog with wrapping enabled just breaks based on the size of the inner textbox, so I'd need some help fully getting BREAK_PATTERN.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's defined below as a regular expression...

private static final Pattern BREAK_PATTERN = Pattern.compile("[\\s,{}:]");
  • \s whitespace
  • , comma
  • { left curly brace
  • } right curly brace
  • : colon

@bratpeki
Copy link
Collaborator

bratpeki commented Dec 3, 2025

Tested and I took a brief look at the code. Everything looks great and I'm sure there's no need for a deeper code review from me.

Also left a suggestion for a "Copy All" functionality, since I'd think that would be a common use for the window. Feel free to ignore, it's intern code! 🤣

Out of curiosity, how does the LogDialog know whether to use the light or dark theme?

@tresf
Copy link
Contributor

tresf commented Dec 3, 2025

Out of curiosity, how does the LogDialog know whether to use the light or dark theme?

We have a theme change detector, then the class just need to implement Themable which will call refresh() when the theme changes.

You mentioned in PM that you were able to cause a hard-crash when this occurred. If if this is the case, we need to patch before merging.

@tresf
Copy link
Contributor

tresf commented Dec 3, 2025

@RebeccaDeField FYI, placeholder artwork committed via 9873086. Feel free to scrutinize and fix on master branch at any time.

@tresf
Copy link
Contributor

tresf commented Dec 3, 2025

@Vzor- I found a weird performance issue....

Running the following code on Ubuntu 24.04 ARM64 VM to spam the logs with the Log Dialog open causes the system to slow to a crawl.

const connectAndDisconnect = () => qz.websocket.isActive() ? qz.websocket.disconnect().then(() => qz.websocket.connect().then(() => qz.websocket.disconnect())) : qz.websocket.connect().then(() => qz.websocket.disconnect()); const connectionInterval = setInterval(connectAndDisconnect, 100);
  1. Changing the log window to only 1 line makes the system responsive
  2. Keep the log window at 500 lines but stopping the spamming of the logs makes the system responsive

If the CPU cycles are being spent on the coloring, we may need to add a checkbox to toggle this off for systems that can't handle it.

Copy link
Contributor

@tresf tresf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to address performance issues on Ubuntu 24.04 ARM as noted here #1385 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log window overflow

3 participants