-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Log a warning when a widget is explicitly activated, but it does not accept focus #1604
Conversation
e910817
to
cdcb308
Compare
private checkActivation(widget: Widget): Widget { | ||
window.requestAnimationFrame(() => { | ||
if (this.activeWidget !== widget) { | ||
this.logger.warn("Widget was activated, but did not accept focus: " + widget.id); |
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 out (removed the if statement to always log); it worked. Unfortunately, this logging does not show up in the browser console but only in the backend console. I do not know whether it was on purpose, but if you would use console.warn
instead of logger.warn
, it would log to both places. What do you think?
[2018-03-30T07:40:52.944Z] WARN: Theia/11837 on prprpr.fritz.box: Widget was activated, but did not accept focus: code-editor-opener:file:///Users/akos.kitta/Desktop/theia/.npmignore []
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.
Does Electron support the browser console?
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 would say; yes. (I have not tried it though.)
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.
Do we have any guideline on when to use console
and when to use ILogger
?
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 am not aware of any.
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 changed this to console.warn
.
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.
console.warn
is good, if you use ILogger
it will end up only on the backend, via console
you can log in the browser console and to the backend at the same time.
…es not accept focus Signed-off-by: Miro Spönemann <miro.spoenemann@typefox.io>
cdcb308
to
06c0028
Compare
This does not really fix #1061, but it helps to find problems in that context.