From 0abac7b58e03fff2a6f578d44f9629c0d30b3da8 Mon Sep 17 00:00:00 2001 From: Gerhard Potgieter Date: Wed, 15 Nov 2017 10:34:28 +0200 Subject: [PATCH] Log to a seperate log file dedicated to images --- .../class-wc-regenerate-images-request.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/includes/class-wc-regenerate-images-request.php b/includes/class-wc-regenerate-images-request.php index dbc95903690..fadc8f24491 100644 --- a/includes/class-wc-regenerate-images-request.php +++ b/includes/class-wc-regenerate-images-request.php @@ -32,7 +32,11 @@ class WC_Regenerate_Images_Request extends WP_Background_Process { */ public function dispatch() { $log = wc_get_logger(); - $log->info( __( 'Starting product image regeneration job.', 'woocommerce' ) ); + $log->info( __( 'Starting product image regeneration job.', 'woocommerce' ), + array( + 'source' => 'wc-image-regeneration', + ) + ); parent::dispatch(); } @@ -59,7 +63,11 @@ class WC_Regenerate_Images_Request extends WP_Background_Process { } $log = wc_get_logger(); // translators: %s: ID of the attachment. - $log->info( sprintf( __( 'Regenerating images for attachment ID: %s', 'woocommerce' ), absint( $attachment->ID ) ) ); + $log->info( sprintf( __( 'Regenerating images for attachment ID: %s', 'woocommerce' ), absint( $attachment->ID ) ), + array( + 'source' => 'wc-image-regeneration', + ) + ); $fullsizepath = get_attached_file( $attachment->ID ); @@ -91,7 +99,11 @@ class WC_Regenerate_Images_Request extends WP_Background_Process { protected function complete() { parent::complete(); $log = wc_get_logger(); - $log->info( __( 'Completed product image regeneration job.', 'woocommerce' ) ); + $log->info( __( 'Completed product image regeneration job.', 'woocommerce' ), + array( + 'source' => 'wc-image-regeneration', + ) + ); }