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

[terminal] Feature Request: Add a property to indicate the minimum accepted message severity #5062

Open
dmichon-msft opened this issue Dec 30, 2024 · 1 comment
Labels
effort: medium Needs a somewhat experienced developer

Comments

@dmichon-msft
Copy link
Contributor

Summary

Currently various libraries and applications that use terminal.writeVerboseLine and similar have no way of knowing if the information will ever make it to a file or the user. If the ITerminal could be inspected to determine the minimum severity of messages that will be visible, the effort of constructing data that is only visible with verbose logging could potentially be skipped where it will not be retained.

Since ultimately the authority on message severity comes from the underlying ITerminalProvider implementations/instances, this information would need to be surfaced there and aggregated inside of ITerminal.

As a specific example, heft-lint-plugin performs a bunch of work to compute ESLint rule timings, but that information is only exposed when running with --verbose:

const timings: [string, number][] = Array.from(this._eslintTimings).sort(
(x: [string, number], y: [string, number]) => {
return y[1] - x[1];
}
);
for (const [ruleName, duration] of timings) {
if (duration > 0) {
this._terminal.writeVerboseLine(`Rule "${ruleName}" duration: ${duration.toFixed(3)} ms`);
} else {
omittedRuleCount++;
}
}
if (omittedRuleCount > 0) {
this._terminal.writeVerboseLine(`${omittedRuleCount} rules took 0ms`);
}

@iclanton
Copy link
Member

iclanton commented Jan 6, 2025

We'd have to be careful to make this not a breaking change because this is currently an implementation detail of individual terminal providers. I think this is a good idea, though.

@iclanton iclanton moved this from Needs triage to Low priority in Bug Triage Jan 6, 2025
@iclanton iclanton added the effort: medium Needs a somewhat experienced developer label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: medium Needs a somewhat experienced developer
Projects
Status: Low priority
Development

No branches or pull requests

2 participants