-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Streamline logging API #14861
Streamline logging API #14861
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.
I have tried it, and it worked very well for me. Thanks
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.
Works for me!
I can confirm that the log config works again, the log-file and log-file renaming works too. Also logging works in general ;)
Note that this is a breaking change because if adopters followed the Theia conventions for creating their loggers, they will now face errors like this
Uncaught Exception: Error: Ambiguous match found for serviceIdentifier: Symbol(ILogger)
Error: Ambiguous match found for serviceIdentifier: Symbol(ILogger)
So we should mention that in the changelog I think
@sdirix Thank you for the hint. I didn't think about that. I added a breaking changelog entry for that :) |
Hello! Does it work for the package as well ? Is there any way for us to get the log file if we run the .exe ? |
@yduuuuuuuu Yes, you just need to start the |
What it does
Fixes #14858
This change fixes a bunch of issues that have been bugging me about the logging API. Due to the previous way of how the binding was done for the
@named
decorator, creating a dedicated logger was quite a lot of work (at least compared to the new binding logic). Now, named loggers are simply created on the fly.Also adds a new
log-file
argument to the CLI. This isn't strictly necessary, as operating systems offer ways of streaming the output of a executable into files, but I find this to be pretty useful anyways, even if just for discoverability.How to test
log-file
CLI argument to see whether this works as expected.Review checklist
Reminder for reviewers