Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: syntax highlight for log viewer #394

Merged
merged 3 commits into from
Jan 3, 2025

Conversation

cristianoventura
Copy link
Collaborator

Description

This PR adds basic syntax highlight for the log viewer in the Settings dialog, making it easy to read and scan issues.

Screenshot 2025-01-02 at 1 02 11 PM

How to Test

  • Check the Logs tab in Settings dialog using Light and Dark themes

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (npm run lint) and all checks pass.
  • I have run tests locally (npm test) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Screenshots (if appropriate):

Related PR(s)/Issue(s)

Resolves #387

@cristianoventura cristianoventura self-assigned this Jan 2, 2025
Comment on lines +6 to +11
root: [
[/\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}]/, 'timestamp'],
[/\[error]/, 'error'],
[/^\s*at.*$/, 'stackTrace'],
[/['"].*?['"]/, 'string'],
],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For now, syntax highlighting is applied only to:

  • timestamps: [2025-01-01 00:00:00.000]
  • error keyword: [error]
  • stack trace line starting with at: at FSWatcher.emit (node:events:518:28)
  • strings: 'string' or "string"

@cristianoventura cristianoventura marked this pull request as ready for review January 2, 2025 18:44
@cristianoventura cristianoventura requested a review from a team as a code owner January 2, 2025 18:44
@cristianoventura cristianoventura requested review from going-confetti, Llandy3d and e-fisher and removed request for a team January 2, 2025 18:44
Copy link
Collaborator

@going-confetti going-confetti left a comment

Choose a reason for hiding this comment

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

🤩

Copy link
Collaborator

@e-fisher e-fisher left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@cristianoventura cristianoventura merged commit 44cc415 into main Jan 3, 2025
2 checks passed
@cristianoventura cristianoventura deleted the feat/syntax-highlight-log branch January 3, 2025 16:48
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.

Add basic syntax highlighting to App Logs
3 participants