-
Notifications
You must be signed in to change notification settings - Fork 1
Add console log and outputs #39
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
Changes from all commits
9c68185
6e9e2c8
31011db
56ba194
c6906c8
7e4710d
211e594
f68bba6
b9b47b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,9 @@ export const debuggerSetup = async (fn) => { | |
consoleLogQueue.push({ method: "log", arguments: arguments }); | ||
return _log.apply(console, arguments); | ||
}; | ||
console.log_without_reporting = function () { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Retain an alias for the original console.log that we can use to output lines only to the console, and not to the user in the UI. |
||
return _log.apply(console, arguments); | ||
}; | ||
|
||
console.warn = function () { | ||
consoleLogQueue.push({ method: "warn", arguments: arguments }); | ||
|
@@ -175,11 +178,7 @@ fastify.post("/command", async (request, reply) => { | |
html: addStyleLinks( | ||
replaceFilePaths(document.documentElement.innerHTML, manifest) | ||
), | ||
error: output.error && { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer report errors separately, just send consoleOutputs with their type. |
||
name: output.error.name, | ||
message: output.error.message, | ||
lineNumber: output.lineNumber, | ||
}, | ||
consoleOutputs: output.consoleOutputs, | ||
}; | ||
}); | ||
|
||
|
@@ -200,7 +199,9 @@ export const start = async (setupFunction) => { | |
await getCssFiles(); | ||
await setupFunction(); | ||
await fastify.listen(3001); | ||
console.log("Debug server is running, open at localhost:3001"); | ||
console.log_without_reporting( | ||
"Debug server is running, open at localhost:3001" | ||
); | ||
while (isListening) { | ||
await sleep(50); | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Add console as a default available command