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

Verbose CLI output #642

Closed
justenh opened this issue Mar 19, 2024 · 3 comments
Closed

Verbose CLI output #642

justenh opened this issue Mar 19, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@justenh
Copy link

justenh commented Mar 19, 2024

Feature Request

Provide more detailed output during CLI execution.

For example, running craft blitz/cache/generate-site 1, it would be great to see which pages are being processed at any given time. This would have the added benefit of providing a way to troubleshoot particularly lengthy generations, or exceptions that cause the command to fail. Ideally, these would be written directly to the CLI during execution so our deployment scripts would capture them as the output of the call. Below is a rough outline of the type of information that might be useful.

Generating Blitz cache for 3 uris.
1. Updated cache "/newsroom/page" (500ms)
2. Updated cache "/newsroom/page-2" (1500ms)
3. Removed cache "/newsroom/page-3" (100ms)

Generated Blitz cache for 18/18 uris
2 updates
1 removals
total time: 2m10s

Additionally, running any CLI that combines multiple commands such as blitz/cache/refresh could output each step of the command being executed. Currently, the refresh command seems to hang with no output.

If the output would cause a slowdown in the execution of the command, it could be flagged on and off. Our preference would be not to hide it behind debug, but instead have it accept a flag of --verbose or something similar.

Plugin Version

No response

@justenh justenh added the enhancement New feature or request label Mar 19, 2024
@bencroker
Copy link
Collaborator

Thanks for the suggestion. I added a verbose output mode to blitz/cache console commands in 097dfc0 that can be activated by adding a --verbose flag. It doesn’t quite report everything in your outline, but it lists URLs as they are generated, noting any errors in red.

You can test this by running ddev composer require "putyourlightson/craft-blitz:dev-develop as 4.14.0".

@justenh
Copy link
Author

justenh commented Mar 20, 2024

Thanks @bencroker! I Just ran through a quick test, and the output is very helpful. I'll continue to test and let you know if anything pops up. Appreciate your quick attention to this request!

@bencroker
Copy link
Collaborator

Released in 4.14.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants