Skip to content

[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

Conversation

dmichon-msft
Copy link
Contributor

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 to IOperationExecutionResult so that they are available to plugins that may wish to interact with them.

Adds a property logServePath to the options for rush-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.

@dmichon-msft dmichon-msft enabled auto-merge (squash) September 20, 2024 00:11
@dmichon-msft dmichon-msft force-pushed the user/dmichon/logging-enhancement branch from 9460c8b to 0fc4acf Compare September 20, 2024 19:55
@dmichon-msft dmichon-msft merged commit 5e45583 into microsoft:main Sep 20, 2024
7 checks passed
@dmichon-msft dmichon-msft deleted the user/dmichon/logging-enhancement branch September 20, 2024 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants