Description
Rather than forward all log messages to WP_CLI::info(), the CLI handler should use the most appropriate logging function available, such as ::error() or ::debug(). See a possible interpretation of the "most appropriate" function for each level at https://l.alley.dev/302f0de39a.
Use Case
Currently, log messages that use the DEBUG log level are sent to WP_CLI::info() rather than WP_CLI::debug(), which means they can't be controlled via the --debug flag like you can when using WP_CLI::debug() directly.
Arguably, any log messages at ERROR or above should use WP_CLI::error() so as to trigger the default WP-CLI behavior of halting script execution for consistency with the behavior that most developers expect when they use WP_CLI::error() directly.
Description
Rather than forward all log messages to
WP_CLI::info(), the CLI handler should use the most appropriate logging function available, such as::error()or::debug(). See a possible interpretation of the "most appropriate" function for each level at https://l.alley.dev/302f0de39a.Use Case
Currently, log messages that use the
DEBUGlog level are sent toWP_CLI::info()rather thanWP_CLI::debug(), which means they can't be controlled via the--debugflag like you can when usingWP_CLI::debug()directly.Arguably, any log messages at
ERRORor above should useWP_CLI::error()so as to trigger the default WP-CLI behavior of halting script execution for consistency with the behavior that most developers expect when they useWP_CLI::error()directly.