-
-
Notifications
You must be signed in to change notification settings - Fork 594
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 --log-level option to vti diagnostics #2752
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
bdd032c
to
ef115c8
Compare
ef115c8
to
2d7f019
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Only some small problems.
vti/src/cli.ts
Outdated
) | ||
.action(async (workspace, options) => { | ||
const logLevelOption: unknown = options.logLevel; | ||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't use logLevels
from import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yoyo930021 Because logLevels
type is readonly ["ERROR", "WARN", "INFO", "HINT"]
, we cannot call logLevels.includes
with unknown value.
related issue: microsoft/TypeScript#26255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use as
keyword or is
function to force it.
Repeated text will cause follow-up maintenance problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yoyo930021 ok. I've removed repeated text. e905cb2
e4b3788
to
e33df10
Compare
Resolves #2723.
vti diagnostics --log-level ERROR
to ignore warns and print only errors.