yii2-debug icon indicating copy to clipboard operation
yii2-debug copied to clipboard

include command debug for yii2

Open chicuongit913 opened this issue 3 years ago • 1 comments

Q A
Is bugfix?
New feature? ✔️ allow debug when execute command
Breaks BC?
Fixed issues

chicuongit913 avatar Jun 28 '22 23:06 chicuongit913

That's great PR 👍. But there are issues:

  1. When trying to view saved console request data, "Request", it ends up with "Calling unknown method: yii\console\Request::getHeaders()".
  2. At the requests index page, it's not prepared to display console return statuses so the color for 0 is red etc. 0 should be green.
  3. At the requests index page titles could be adjusted to reflect commands i.e. "URL/command" instead of "URL" etc.
  4. At the toolbar, "route" title could be either adjusted or, better, removed since it's not "Route" anymore.

samdark avatar Sep 04 '22 09:09 samdark

That's great PR 👍. But there are issues:

  1. When trying to view saved console request data, "Request", it ends up with "Calling unknown method: yii\console\Request::getHeaders()".
  2. At the requests index page, it's not prepared to display console return statuses so the color for 0 is red etc. 0 should be green.
  3. At the requests index page titles could be adjusted to reflect commands i.e. "URL/command" instead of "URL" etc.
  4. At the toolbar, "route" title could be either adjusted or, better, removed since it's not "Route" anymore.

Fixed!

chicuongit913 avatar Sep 04 '22 16:09 chicuongit913

Awesome. Would you please add a line for CHANGELOG?

samdark avatar Sep 04 '22 18:09 samdark

added change log

chicuongit913 avatar Sep 04 '22 18:09 chicuongit913

Thanks!

samdark avatar Sep 04 '22 19:09 samdark

Hi Samdark, i just curious that when you will publish the tag 2.1.21?

chicuongit913 avatar Sep 06 '22 15:09 chicuongit913

Well, nothing's holding me from doing it right now :)

samdark avatar Sep 06 '22 17:09 samdark

Done.

samdark avatar Sep 06 '22 17:09 samdark

great, thanks

chicuongit913 avatar Sep 06 '22 18:09 chicuongit913

@chicuongit913 This is a great PR! Thank you. Now we are even able to debug queue jobs without pain! Thanks

nadar avatar Sep 06 '22 19:09 nadar

Is there some documentation about how to perform commands debugging?

vadim-bulochnik avatar Sep 07 '22 16:09 vadim-bulochnik

@vadim-bulochnik just add the debug toolbar to the console.php configuration and you are done.

nadar avatar Sep 07 '22 16:09 nadar

@vadim-bulochnik => https://github.com/yiisoft/yii2-app-basic/pull/277

nadar avatar Sep 07 '22 16:09 nadar

@vadim-bulochnik just add the debug toolbar to the console.php configuration and you are done.

Yes, this is done. But how to use this debug toolbar in console? :) Sorry for stupid question.

vadim-bulochnik avatar Sep 07 '22 16:09 vadim-bulochnik

Just as you normally would, via browser http://localhost/debug (or whatever setup you have) and you will see the console requests "flagged" as COMMAND (instead of GET, POST, etc.)

nadar avatar Sep 07 '22 17:09 nadar

Just as you normally would, via browser http://localhost/debug (or whatever setup you have) and you will see the console requests "flagged" as COMMAND (instead of GET, POST, etc.)

Thanks, but I still can't see console requests. I have a feeling that for console need to setup another url for debug toolbar, because for example debug toolbar in backend application shows only logs from backend, and debug toolbar in frontend application - shows logs from frontend. Thus, I think should be a way to setup debug toolbar for console application, but not sure how.

vadim-bulochnik avatar Sep 07 '22 17:09 vadim-bulochnik

Yes. For advanced template there are some adjustments needed so app writes its data to one of backend/frontend directories.

samdark avatar Sep 07 '22 20:09 samdark

Yes. For advanced template there are some adjustments needed so app writes its data to one of backend/frontend directories.

Thanks for information! Will wait for improvements :)

vadim-bulochnik avatar Sep 09 '22 18:09 vadim-bulochnik

Hi Alexander,

I just curious that do you have plan to release the version 2.1.21 for yii/debug, my team members need that feature for debugging.

Thanks

Vào CN, 4 thg 9, 2022 vào lúc 12:11 Alexander Makarov < @.***> đã viết:

Thanks!

— Reply to this email directly, view it on GitHub https://github.com/yiisoft/yii2-debug/pull/490#issuecomment-1236398537, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBGE47U567AI5SQHEKAFKDV4TX5TANCNFSM52D3OLJQ . You are receiving this because you authored the thread.Message ID: @.***>

chicuongit913 avatar Oct 11 '22 07:10 chicuongit913

@chicuongit913 it has been released already 2.1.21 September 06, 2022

nadar avatar Oct 11 '22 11:10 nadar

@chicuongit913 it has been released already 2.1.21 September 06, 2022

Yes, but this version doesn't include commands debug support for advanced template.

vadim-bulochnik avatar Oct 12 '22 11:10 vadim-bulochnik

It's easy to add yourself in console app bootstrap.

samdark avatar Oct 12 '22 14:10 samdark

It's easy to add yourself in console app bootstrap.

I didn't manage to find corresponding configuration of Debug module for this.

vadim-bulochnik avatar Oct 12 '22 15:10 vadim-bulochnik

It's easy to add yourself in console app bootstrap.

Do you mean this param? /** * @var string the directory storing the debugger data files. This can be specified using a path alias. */ public $dataPath = '@runtime/debug';

vadim-bulochnik avatar Oct 12 '22 15:10 vadim-bulochnik

Yes.

samdark avatar Oct 12 '22 15:10 samdark