Open Luc45 opened 2 years ago
Hey @Luc45,
Thanks for the suggestion!
I have a use-case where I need the output that was generated for logging reasons.
I'm a little hesitant about changing the output solely for this use case.
What do you think about instead running the $result
through an action, so your custom code can capture and report the output however you need?
If a plugin generates output during activation,
activate_plugin
will return anWP_Error
object configured like this:As you can see, the output is passed as the third parameter, and the error has code "unexpected_output".
I have a use-case where I need the output that was generated for logging reasons.
Relevant code that should print the output:
https://github.com/wp-cli/extension-command/blob/409b3f6defa9d02f32b5f04bbf969a9906e1f6de/src/Plugin_Command.php#L347-L354