update remaining print_r in HPOS code
This commit is contained in:
parent
ada3031725
commit
f012b4d038
|
@ -494,8 +494,7 @@ class CLIRunner {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r -- This is a CLI command and debugging code is intended.
|
$errors = wp_json_encode( $failed_ids, JSON_PRETTY_PRINT );
|
||||||
$errors = print_r( $failed_ids, true );
|
|
||||||
|
|
||||||
return WP_CLI::error(
|
return WP_CLI::error(
|
||||||
sprintf(
|
sprintf(
|
||||||
|
|
|
@ -368,13 +368,12 @@ class BatchProcessingController {
|
||||||
$batch_detail_string = '';
|
$batch_detail_string = '';
|
||||||
// Log only first and last, as the entire batch may be too big.
|
// Log only first and last, as the entire batch may be too big.
|
||||||
if ( count( $batch ) > 0 ) {
|
if ( count( $batch ) > 0 ) {
|
||||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r -- Logging is for debugging.
|
$batch_detail_string = "\n" . wp_json_encode(
|
||||||
$batch_detail_string = '\n' . print_r(
|
|
||||||
array(
|
array(
|
||||||
'batch_start' => $batch[0],
|
'batch_start' => $batch[0],
|
||||||
'batch_end' => end( $batch ),
|
'batch_end' => end( $batch ),
|
||||||
),
|
),
|
||||||
true
|
JSON_PRETTY_PRINT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$error_message = "Error processing batch for {$batch_processor->get_name()}: {$error->getMessage()}" . $batch_detail_string;
|
$error_message = "Error processing batch for {$batch_processor->get_name()}: {$error->getMessage()}" . $batch_detail_string;
|
||||||
|
|
|
@ -1308,8 +1308,7 @@ WHERE
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function log_diff( array $diff ): void {
|
private function log_diff( array $diff ): void {
|
||||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r -- This is a log function.
|
$this->error_logger->notice( 'Diff found: ' . wp_json_encode( $diff, JSON_PRETTY_PRINT ) );
|
||||||
$this->error_logger->notice( 'Diff found: ' . print_r( $diff, true ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue