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
Expose logger in web embedder API #147035
Conversation
Can I understand the use case or provide me with the context for this requirement? |
@sandy081 the context in detail was explained here: https://github.com/microsoft/vscode-dev/issues/555#issuecomment-1086432256 Essentially we do work in the embedder to set up the remote connection and we'd like to be able to show progress and logs of the set up but we don't have access to the extension host in the embedder to do so today. |
Thanks for providing the context. It seems like |
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
@tanhakabir Creating an output channel is more powerful and generic API and I am not sure if the embedder wants to leverage all of it. This API also provides ability to create multiple output channels and I do not know if embedder has such a need. If this is embedder log, then how about exposing following logging api to the embedder log(level: LogLevel, message: string) Workbench will implement this API and logs messages as per log level. If wanted, workbench can create a separate logger for embedder. |
3fc74d9
to
0610ed0
Compare
0610ed0
to
c2a1cb6
Compare
I think we need to start thinking about a better place where the embedder API is implemented, I do not think that workbench core is good, esp. since we have a |
@bpasero I haven't worked within the vscode repo much yet so I don't have the best context but I agree that the contrib model would make more sense here with the WebEmbedderLog. To clarify though did you mean just the logger should follow the contrib model or some larger refractoring to |
I think we cannot avoid having the API all in one place, but maybe the implementation could be spread to respective components. E.g. the output component can apply its properties to the embedder API object. |
Closing in favor of #147728 |
As discussed in #147728 (comment) reopening this PR for the April iteration to get access to a logger in the embedder. cc @bpasero |
- Register log chanel only when logging is attempted
@tanhakabir I pushed following changes
I agree with @bpasero's comment on namespace for |
Since we are in endgame week already, shall we push this to next milestone or is there an urgency to push it for this milestone? |
Looks much cleaner how, thanks for chiming in ❤️ |
We can push this into the next iteration but early in the iteration is preferable. |
Great. We can push it as soon as the |
Pushed a small addition but otherwise looks great! Thanks so much for your help @sandy081! ❤️ |
Made the change you requested but you're on paternity leave and I was hoping to get this PR in soon so I want to dismiss this review
Ref: https://github.com/microsoft/vscode-dev/issues/555
@sandy081 I want to expose creating Output Channels to the embedder API but I noticed that all of Output is undervs/workbench/contrib
which is not allowed to be imported invs/workbench/browser/web.api.ts
. When I exposed Progress in #147033 I didn't have any issues since progress was invs/platform
which was safe to import. Do you have any suggestions for a safe way to expose the Output API?This exposes the OutputChannel service in the web API to be used in vscode.dev in the embedders