Skip to content

CLI handler should use WP-CLI logging methods #138

Description

@dlh01

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions