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

Add option for running the logger with flushing to disk after each log call #80862

Closed
alexdima opened this issue Sep 13, 2019 · 7 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality log VS Code log issues verification-needed Verification of issue is requested verified Verification succeeded

Comments

@alexdima
Copy link
Member

It is currently very difficult to troubleshoot crashing extension host issues because the logs could be missing data that was not synchronously flushed to disk after each log call.

@alexdima
Copy link
Member Author

@joaomoreno @sandy081 Could you please squeeze this in for September? I would like to enable the extension host to always use synchronous flushing to disk after each log call so I can troubleshoot crashes...

@joaomoreno
Copy link
Member

I think we should do this with an env variable or cli argument, since as a setting we might not be able to read it as early as we'd like at startup and we'd only want this for troubleshooting. My preference would be with an env variable, since that propagates effortlessly. Is that OK @alexandrudima?

@alexdima
Copy link
Member Author

@joaomoreno I would hard-code the extension host to always use synchronous flushing.

TBH I don't understand why one would ever use logging without synchronously flushing ^^

@sandy081
Copy link
Member

Because this will block every time a log statement is written. I cannot say how much it will impact the perf but why do not this is optional and enable this only when needed?

@sandy081
Copy link
Member

sandy081 commented Sep 26, 2019

Anyways, I have added a constructor option sync in SpdLogService which is false by default. Passing true will flush the log after each call - d34109e

After we decide between env variable or cli argument, we can create SpdLogService accordingly.

@sandy081
Copy link
Member

As discussed exposed flush method on logService to flush logs.

@joaomoreno joaomoreno added the verification-needed Verification of issue is requested label Sep 30, 2019
@alexdima
Copy link
Member Author

Thank you! ❤️

alexdima added a commit that referenced this issue Sep 30, 2019
@jrieken jrieken added the verified Verification succeeded label Oct 1, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality log VS Code log issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants