Skip to content

Debug logger #213

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

Merged
merged 4 commits into from
May 21, 2021
Merged

Debug logger #213

merged 4 commits into from
May 21, 2021

Conversation

AydinHassan
Copy link
Member

@AydinHassan AydinHassan commented May 21, 2021

Adds a new --debug flag which will print all logging to the console if present.

I had to refactor the menu closing, because that was currently done in the ExerciseRenderer which seems odd anyway, but that was causing the screen to be cleared after the exercise selected event was triggered, so anything logged then would be overwritten. I've changed it to close the menu as soon as we are in the callback for selecting an exercise.

@AydinHassan AydinHassan marked this pull request as ready for review May 21, 2021 16:35
@AydinHassan AydinHassan requested a review from mikeymike May 21, 2021 16:35
@@ -82,8 +82,6 @@ public function __construct(
*/
public function __invoke(CliMenu $menu): void
{
$menu->close();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering why 👀

@@ -59,6 +59,7 @@ public function __invoke(ContainerInterface $c): CliMenu
$builder->addItem(
$exercise->getName(),
function (CliMenu $menu) use ($exerciseRenderer, $eventDispatcher, $exercise) {
$menu->close();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it moved here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, read the pr description!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah jesus, my bad 😂 🤦

@AydinHassan AydinHassan merged commit c496fec into master May 21, 2021
@AydinHassan AydinHassan deleted the debug-logger branch May 21, 2021 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants