Pierre-Lannoy / wp-decalog

Capture and log events, metrics and traces on your site. Make WordPress observable - finally!
https://perfops.one/
GNU General Public License v3.0
64 stars 8 forks source link

CLI commands 'wp log listener enable/disable' work incorrectly #38

Closed AlexMazey closed 1 year ago

AlexMazey commented 1 year ago

Describe the bug When I try to run a CLI command 'wp log listener disable wpdb' it returns a message 'Invalid listener id supplied' and exit. The 'wpdb' listener definitely exists, as it is a standard one and it is shown in the listeners list after running 'wp log listener list'.

The root cause is in the line 1146 of includes/features/class-wpcli.php https://github.com/Pierre-Lannoy/wp-decalog/blob/master/includes/features/class-wpcli.php Looks like the $listeners array is always empty in that condition, so the $uuid becomes empty for each command with arguments.

To Reproduce Steps to reproduce the behavior:

  1. Open any tool to run a WP CLI.
  2. Run the command: wp log listener disable wpdb
  3. See the error message

Expected behavior Disabling the specified listener, in case of disable command. Enabling the specified listener, in case of enable command.

Environment (please complete the following information):

Pierre-Lannoy commented 1 year ago

OMG 😱 I confirm the bug. Let me see what's going on…

Pierre-Lannoy commented 1 year ago

New 3.6.2 version released. Can you confirm it fixes the issue? Thanks

AlexMazey commented 1 year ago

Hello Pierre,

I have just tested the latest version and I confirm that the issue is fixed. Thank you for the quick response!