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

Debug output for Logic side effects #447

Closed
g105b opened this issue Mar 28, 2021 · 4 comments
Closed

Debug output for Logic side effects #447

g105b opened this issue Mar 28, 2021 · 4 comments
Projects

Comments

@g105b
Copy link
Member

g105b commented Mar 28, 2021

Logic classes should have no side effect. If they do, for example by echoing something, webengine should throw an exception

If anything is output to the buffer before the Lifecycle::finish function is called, this should be collected and output into a special debug area of the page.

Would it be nice to put it in the JavaScript console, instead of directly into the HTML? Probably...

@g105b g105b changed the title Throw exception if logic produces side effect Debug output for Logic side effects. Jun 17, 2021
@g105b g105b added this to Backlog in Overview Oct 9, 2021
@g105b g105b changed the title Debug output for Logic side effects. Debug output for Logic side effects Aug 11, 2022
@g105b
Copy link
Member Author

g105b commented Aug 18, 2022

This would be nice to be put into the Gt\WebEngine\Debug namespace, as we already have one with just the Timer class.

@g105b g105b moved this from Backlog to WIP in Overview Sep 22, 2022
@g105b
Copy link
Member Author

g105b commented Sep 23, 2022

Now anything echoed to the page is output as a console.log, it would be nice to provide a default friendly error page and output the actual error into the JavaScript console (only developers need see it!)

@g105b
Copy link
Member Author

g105b commented Sep 23, 2022

Follows on from #299

g105b added a commit that referenced this issue Sep 25, 2022
@g105b
Copy link
Member Author

g105b commented Nov 26, 2022

Current implementation is nearly completed.

The RequestHandler::handleLogicExecution is storing the buffer correctly in the Lifecycle's debugOutput array, but still to do is understand which file's go/do functions are the trigger of the buffer. This could be done by converting LogicExecutor::invoke to a Generator function: the generator can yield a filename each time it executes the function, allowing the RequestHandler to iterate over the invoke call, adding the output buffer to the correct debug stream.

g105b added a commit that referenced this issue Nov 27, 2022
@g105b g105b closed this as completed in b79566a Dec 2, 2022
Overview automation moved this from WIP to Done November 2022 Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Overview
Done November 2022
Development

No branches or pull requests

1 participant