-
Notifications
You must be signed in to change notification settings - Fork 581
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
Refactor all logging to go through a logger object #10249
Conversation
This was quick and awesome. |
I don't understand why this is a breaking change. The new logger stuff that you made is completely separate from |
@@ -0,0 +1,67 @@ | |||
namespace pxt { |
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 take it there's no nice, shared location both pxtsim and pxtlib can consume this from as a single file?
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.
nope...
} | ||
// console.log(`${mkIndent(depth)}REFS: ${referenced}`) | ||
// pxt.log(`${mkIndent(depth)}REFS: ${referenced}`) |
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.
Why not get rid of these commented out logs? Will we ever reenable them? Or are they just used in dev scenarios and we want to leave them here for quick access?
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 dunno! i didn't add them, so i'm not touching them :)
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.
Nice!
webapp/src/serial.tsx
Outdated
@@ -200,7 +200,7 @@ export class Editor extends srceditor.Editor { | |||
} | |||
if (this.isVisible) { | |||
if (this.isCsvView && !this.receivedCsv) { | |||
// have not received a csv yet but in csv view; swap back to console. | |||
// have not received a csv yet but in csv view; swap back to pxt. |
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.
Not 100% sure what this comment is referring to, but my guess is it should still be "console" here?
@srietkerk this redefines pxt.log it was previously a variable that pointed to a function, so you could overwrite it. with this change, it's now just a function. you can still overwrite with monkey patching but TS will complain |
This PR is part one of my effort to add a backdoor for getting console logs from the ingame experience in minecraft.
i guess this is technically a breaking change, because
pxt.log
used to be a function that could be overwritten, but AFAIK we never actually did that so i think we should be good.