Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for watchdog:show --exclude-type #6148

Closed
gitressa opened this issue Oct 30, 2024 · 7 comments · Fixed by #6152
Closed

Add support for watchdog:show --exclude-type #6148

gitressa opened this issue Oct 30, 2024 · 7 comments · Fixed by #6152

Comments

@gitressa
Copy link
Contributor

Is your feature request related to a problem? Please describe.

If you have installed a Drupal site in another language than English, you may get a lot of "English translation file not found" errors for all contrib modules (for example https://ftp.drupal.org/files/translations/all/metatag/metatag-2.0.2.en.po.) at every Cron run.

See Drupal install throwing "Translation file not found" notice for "en" langcode when "translate_english" is set to false.

These false positive entries can fill up the database log, and thereby drush watchdog:show output.

Describe the solution you'd like

As a workaround, it would be nice to be able to exclude a type. For example:

drush watchdog:show --exclude-type=locale    Exclude messages of type locale

This could also be a nice feature for example for Cron, which has a lot of entries.

Describe alternatives you've considered

You could enter all the other types, but that is clunky.

@weitzman
Copy link
Member

You want Drush's output filtering feature. It is criminally underused. This use case is solved by drush watchdog:show --filter="type!=locale". A lot of options in watchdog:show could alternatively be done with output filters.

@weitzman
Copy link
Member

Anyone is welcome to add another Example in Help with this info.

weitzman pushed a commit that referenced this issue Oct 31, 2024
@gitressa
Copy link
Contributor Author

Thanks for making me aware of the output filter in Drush, that is indeed very cool!

I created an MR, which adds your example to the list of Watchdog help items, since that command is one where the filter feature can often be useful.

@gitressa
Copy link
Contributor Author

Thanks, very fast! I just re-read the sentence, and realized that the filter feature, which is the main character here, is not mentioned ... Perhaps this would be better?

Now:

Exclude rows via the negation operator !

Better?

Exclude rows with the filter feature, via the negation operator !

@weitzman
Copy link
Member

Yes, its better. I have some sad news to report tho. Drush is moving even further toward a native Symfony Console setup and these example descriptions may be a casualty. See symfony/symfony#45050

@gitressa
Copy link
Contributor Author

Losing the examples under each Drush command would definitely be a setback ... it's so great to have them available right there when you need them.

I hope, since Drupal and Drush are big players (I assume) in the Symfony world, that they may help steer Symfony in a direction where some kind of help feature can stay available in Drush.

@gitressa
Copy link
Contributor Author

Oh, and about the little improvement, should I make a new PR, or can you do it directly?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants