diff --git a/facebook-commerce.php b/facebook-commerce.php index 851b480e6..fbace4002 100644 --- a/facebook-commerce.php +++ b/facebook-commerce.php @@ -1343,23 +1343,6 @@ public function update_product_group( WC_Facebook_Product $woo_product ) { $variants = $woo_product->prepare_variants_for_group(); if ( ! $variants ) { - Logger::log( - sprintf( - /* translators: %1$s is referring to facebook product group id. */ - __( - 'Nothing to update for product group for %1$s', - 'facebook-for-woocommerce' - ), - $fb_product_group_id - ), - [], - array( - 'should_send_log_to_meta' => false, - 'should_save_log_in_woocommerce' => true, - 'woocommerce_log_level' => \WC_Log_Levels::DEBUG, - ) - ); - return; } @@ -2249,7 +2232,7 @@ private function sync_facebook_products_using_background_processor() { array( 'should_send_log_to_meta' => false, 'should_save_log_in_woocommerce' => true, - 'woocommerce_log_level' => \WC_Log_Levels::DEBUG, + 'woocommerce_log_level' => \WC_Log_Levels::WARNING, ) ); throw new PluginException( __( 'The plugin is not configured or the Catalog ID is missing.', 'facebook-for-woocommerce' ) ); @@ -2304,7 +2287,7 @@ private function sync_facebook_products_using_background_processor() { array( 'should_send_log_to_meta' => false, 'should_save_log_in_woocommerce' => true, - 'woocommerce_log_level' => \WC_Log_Levels::DEBUG, + 'woocommerce_log_level' => \WC_Log_Levels::WARNING, ) ); WC_Facebookcommerce_Utils::fblog( diff --git a/includes/Framework/ErrorLogHandler.php b/includes/Framework/ErrorLogHandler.php index 1db527606..0aef997cc 100644 --- a/includes/Framework/ErrorLogHandler.php +++ b/includes/Framework/ErrorLogHandler.php @@ -49,13 +49,27 @@ public function process_error_log( $raw_context ) { $context = self::set_core_log_context( $raw_context ); try { $response = facebook_for_woocommerce()->get_api()->log_to_meta( $context ); - if ( $response->success ) { - WC_Facebookcommerce_Utils::log_with_debug_mode_enabled( 'Error log: ' . wp_json_encode( $context ), \WC_Log_Levels::ERROR ); - } else { - WC_Facebookcommerce_Utils::log_with_debug_mode_enabled( 'Bad response from log_to_meta request', \WC_Log_Levels::ERROR ); + if ( ! $response->success ) { + Logger::log( + 'Bad response from log_to_meta request', + [], + array( + 'should_send_log_to_meta' => false, + 'should_save_log_in_woocommerce' => true, + 'woocommerce_log_level' => \WC_Log_Levels::ERROR, + ) + ); } } catch ( \Exception $e ) { - WC_Facebookcommerce_Utils::log_with_debug_mode_enabled( 'Error persisting error logs: ' . $e->getMessage(), \WC_Log_Levels::ERROR ); + Logger::log( + 'Error persisting error logs: ' . $e->getMessage(), + [], + array( + 'should_send_log_to_meta' => false, + 'should_save_log_in_woocommerce' => true, + 'woocommerce_log_level' => \WC_Log_Levels::ERROR, + ) + ); } } diff --git a/includes/fbproduct.php b/includes/fbproduct.php index 592d2e807..92baa272b 100644 --- a/includes/fbproduct.php +++ b/includes/fbproduct.php @@ -2107,8 +2107,6 @@ public function prepare_variants_for_item( &$product_data ) { break; }//end switch } else { - - \WC_Facebookcommerce_Utils::log_with_debug_mode_enabled( $product->get_id() . ': No options for ' . $original_variant_name ); continue; }//end if }//end foreach @@ -2162,7 +2160,6 @@ public function prepare_variants_for_group( $feed_data = false ) { $option_values = $variation_attributes[ $key ]; } else { // skip variations without valid attribute options - \WC_Facebookcommerce_Utils::log_with_debug_mode_enabled( $product->get_id() . ': No options for ' . $name ); continue; }