-
Notifications
You must be signed in to change notification settings - Fork 631
[rush] Logging enhancements #4929
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
Merged
dmichon-msft
merged 4 commits into
microsoft:main
from
dmichon-msft:user/dmichon/logging-enhancement
Sep 20, 2024
Merged
[rush] Logging enhancements #4929
dmichon-msft
merged 4 commits into
microsoft:main
from
dmichon-msft:user/dmichon/logging-enhancement
Sep 20, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
D4N14L
approved these changes
Sep 19, 2024
libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts
Outdated
Show resolved
Hide resolved
D4N14L
reviewed
Sep 19, 2024
D4N14L
approved these changes
Sep 20, 2024
iclanton
approved these changes
Sep 20, 2024
iclanton
approved these changes
Sep 20, 2024
9460c8b
to
0fc4acf
Compare
dmichon-msft
commented
Sep 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Leaves ANSI escape codes present in the JSONL log files, so that color information will be preserved when replaying from cache.
Adds a property
logFilePaths
toIOperationExecutionResult
so that they are available to plugins that may wish to interact with them.Adds a property
logServePath
to the options forrush-serve-plugin
that specifies a base path under which all log files will be made available via the local server.Details
The
logFilePaths
property will only be defined for operations that created log files.Served files are all in a single flat directory. This may cause collisions if two projects in the same repository have the same unscoped package name, since the naming convention for log files uses the unscoped package name, rather than the full package name.
Refactors logging-related code to have ProjectLogWritable construct the splitter and text rewriter internally, rather than it being the responsibility of the caller. This facilitates routing the raw log directly to the JSONL output and separately performing the newline rewriting and ANSI escape code trimming only for text logs.
How it was tested
Built with
FORCE_COLOR=1
and verified that the jsonl logs contained the ANSI escape codes from Heft formatting.Wired up
rush-serve-plugin
in the repository temporarily and validated that WebSocket messages contained information about log files. Also checked that the referenced log files could be fetched.Impacted documentation
Documentation for rush-serve-plugin, mainly regarding the schema. The examples for use of websocket will be extended in a future PR when we have a fully functional dashboard to submit.