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

Make the logger accessible outside the inversify context #517

Closed
hexa00 opened this issue Sep 14, 2017 · 4 comments
Closed

Make the logger accessible outside the inversify context #517

hexa00 opened this issue Sep 14, 2017 · 4 comments

Comments

@hexa00
Copy link

hexa00 commented Sep 14, 2017

It would be nice to be able to use the logger outside of the inversify context.

For example in the Globalize PR we would need to do this to avoid using console.log

An idea discussed has been to use a global variable to the logger singleton and bind that to the global console so that any use of console.log goes though our logger.

I would suggest theia's code still use logger.log however

@hexa00
Copy link
Author

hexa00 commented Sep 21, 2017

@svenefftinge @akosyakov We need to do this for other things too like the MessageTranslation class in the globalize PR.

However I don't understand where we would export a global variable from the container.

It looks like the correct place would be in src-gen/server.ts for example where the container is created but that doesn't make sense since a package won't be able to import that...

Any ideas on this ?

@svenefftinge
Copy link
Contributor

I think it would be a side-effect on an existing global when the container is created.

@hexa00
Copy link
Author

hexa00 commented Sep 22, 2017

Haaa yes ok that would work good point thx! :)
We will have to watchout for that however, I think extensions will need to register a function to be called on container creation so that this can be setup properly

@hexa00
Copy link
Author

hexa00 commented Oct 4, 2017

Fixed in #562

@hexa00 hexa00 closed this as completed Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants