Skip to content

Add logging to discoverTypings#16652

Merged
2 commits merged into
masterfrom
discoverTypings_log
Jul 13, 2017
Merged

Add logging to discoverTypings#16652
2 commits merged into
masterfrom
discoverTypings_log

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jun 20, 2017

Fixes #16203 (the logging part anyway)
Must wait on #16632 and then be rebased.

@ghost ghost requested a review from jramsay June 20, 2017 18:14
Comment thread src/services/jsTyping.ts
*/
export function discoverTypings(
host: TypingResolutionHost,
log: ((message: string) => void) | undefined,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this just be ((message: string) => void) with default parameter of function that do nothing.... so we don't have to check whether the log parameter is defined

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're doing this kind of pattern (if (this.log.isEnabled()) this.log.writeLine(...)) for logging in typingsInstaller, I think for performance so that we don't allocate strings that we won't need. It may not matter compared to all the I/O we're doing though.

@ghost ghost force-pushed the discoverTypings_log branch from 950046a to 2e0fda7 Compare June 23, 2017 17:09
@ghost ghost force-pushed the discoverTypings_log branch from 2e0fda7 to 9090096 Compare June 23, 2017 18:39
@ghost ghost force-pushed the discoverTypings_log branch from 34c528f to b893606 Compare July 12, 2017 14:30
@ghost ghost merged commit efc861c into master Jul 13, 2017
@ghost ghost deleted the discoverTypings_log branch July 13, 2017 14:10
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants