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

Add support for pretty-printed JSON logs #674

Merged
merged 4 commits into from
Jan 2, 2025
Merged

Conversation

sarub0b0
Copy link
Owner

@sarub0b0 sarub0b0 commented Dec 16, 2024

This pull request implements a feature that allows users to toggle pretty print for JSON logs in the log view. By pressing the p or f key, users can switch between the standard and pretty-printed formats, making it easier to read structured JSON logs.

Related to #652

@sarub0b0 sarub0b0 linked an issue Dec 16, 2024 that may be closed by this pull request
@sarub0b0 sarub0b0 added this to the 1.6.0 milestone Dec 16, 2024
@sarub0b0 sarub0b0 force-pushed the 652-pretty-print-json-logs branch 2 times, most recently from 3b7194c to 1f68469 Compare December 18, 2024 17:00
- Introduced `json_pretty_print` field in `LogConfig` to toggle JSON
  pretty print.
- Updated `LogWorker` and `LogCollector` to handle the new field.
- Added `LogContent` struct to manage log content and prefix.
- Modified `LogStreamer` to use `LogContent` and support JSON pretty
  print.
- Implemented `ToggleJsonPrettyPrint` message to toggle the pretty
  print option.
- Updated UI to include a key binding for toggling JSON pretty print.
- Added a new key binding for toggling JSON pretty print in the log
  help section.
- Updated the `HelpBlock` for logs to include the new key binding.
- Added 'f' key binding alongside 'p' to toggle JSON pretty print in
  the log help section.
- Updated the log widget to handle the new 'f' key binding for toggling
  JSON pretty print.
- Updated README.md to include information about toggling JSON log display
  between pretty print and single-line using the <kbd>f</kbd> or <kbd>p</kbd>
  keys.
- Reformatted the "Pods List and Container Logs" feature description for
  better readability.
@sarub0b0 sarub0b0 force-pushed the 652-pretty-print-json-logs branch from 1f68469 to 7c01638 Compare January 2, 2025 05:54
@sarub0b0 sarub0b0 merged commit b19afe4 into main Jan 2, 2025
1 check passed
@sarub0b0 sarub0b0 deleted the 652-pretty-print-json-logs branch January 2, 2025 05:57
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.

Improvements for logs
1 participant