Skip to content

feat(log): enhance cmd highlighter and make it configurable#1122

Merged
antongolub merged 6 commits intogoogle:mainfrom
antongolub:fix-format-cmd
Mar 10, 2025
Merged

feat(log): enhance cmd highlighter and make it configurable#1122
antongolub merged 6 commits intogoogle:mainfrom
antongolub:fix-format-cmd

Conversation

@antongolub
Copy link
Collaborator

@antongolub antongolub commented Mar 8, 2025

This PR:

  • enhances formatCmd helper to properly highlight cmds and their params
  • separates log module
  • makes cmd formatter configurable via log.formatCmd
  • makes the default log stream customizable through log.output
  • adds missing log() tests

closes #1119

@antonmedv
@stefansundin

Could you plz provide more examples as is vs to be.

telegram-cloud-photo-size-2-5359362378266964266-y

  • Tests pass
  • Appropriate changes to README are included in PR

@stefansundin
Copy link

It looks good to me, although I haven't checked out the code to do any testing on my own.

It might be worth checking how these are colored:

echo test > filepath
echo test >> filepath
echo test 2> filepath
echo test &> filepath
echo test &>> filepath
echo test >& filepath
echo 1+2 | bc
bc < filepath

Maybe overly complicated:

cat << 'EOF' | tee -a filepath
line 1
line 2
EOF

@antongolub
Copy link
Collaborator Author

image

@antongolub antongolub changed the title fix: enhance cmd highligher feat(log): enhance cmd highlighter and make it configurable Mar 9, 2025
@antongolub antongolub merged commit 85c260c into google:main Mar 10, 2025
24 checks passed
@antongolub antongolub deleted the fix-format-cmd branch March 10, 2025 09:17
antongolub added a commit to antongolub/zx that referenced this pull request Mar 10, 2025
antonmedv pushed a commit that referenced this pull request Mar 10, 2025
* feat(log): provide custom formatting for every entry kind

continues #1122

* chore: ignore unknown log entries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minor verbose command coloring bug

3 participants