Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion facebook-commerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -2784,7 +2784,6 @@ public function update_fb_visibility( $product_id, $visibility ) {
} else {
$fb_product_item_id = $this->get_product_fbid( self::FB_PRODUCT_ITEM_ID, $product->get_id() );
if ( ! $fb_product_item_id ) {
\WC_Facebookcommerce_Utils::fblog( $fb_product_item_id . " doesn't exist but underwent a visibility transform.", [], true );
return;
}
try {
Expand Down
18 changes: 12 additions & 6 deletions includes/RolloutSwitches.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use WooCommerce\Facebook\Framework\Api\Exception;
use WooCommerce\Facebook\Utilities\Heartbeat;
use WooCommerce\Facebook\Framework\Logger;

defined( 'ABSPATH' ) || exit;

Expand Down Expand Up @@ -78,12 +79,17 @@ public function init() {
}
}
update_option( self::SETTINGS_KEY, $fb_options );
\WC_Facebookcommerce_Utils::fblog(
$e,
[
'event' => 'rollout_switches',
'event_type' => 'init',
]
Logger::log(
$e->getMessage(),
array(
'flow_name' => 'rollout_switches',
'flow_step' => 'init',
),
array(
'should_send_log_to_meta' => true,
'should_save_log_in_woocommerce' => true,
'woocommerce_log_level' => \WC_Log_Levels::ERROR,
)
);
}
}
Expand Down
18 changes: 10 additions & 8 deletions includes/fbproduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use WooCommerce\Facebook\Framework\Helper;
use WooCommerce\Facebook\Handlers\PluginRender;
use WooCommerce\Facebook\Products;
use WooCommerce\Facebook\Framework\Logger;

defined( 'ABSPATH' ) || exit;

Expand Down Expand Up @@ -284,11 +285,6 @@ public function __call( $func, $args ) {
if ( $this->woo_product ) {
return call_user_func_array( array( $this->woo_product, $func ), $args );
} else {
WC_Facebookcommerce_Utils::fblog(
"Calling $func on Null Woo Object.\n",
array(),
true
);
return null;
}
}
Expand Down Expand Up @@ -2215,9 +2211,15 @@ public function prepare_variants_for_group( $feed_data = false ) {
);
}//end foreach
} catch ( \Exception $e ) {

\WC_Facebookcommerce_Utils::fblog( $e->getMessage() );

Logger::log(
$e->getMessage(),
[],
array(
'should_send_log_to_meta' => false,
'should_save_log_in_woocommerce' => true,
'woocommerce_log_level' => \WC_Log_Levels::ERROR,
)
);
return array();
}//end try

Expand Down
5 changes: 2 additions & 3 deletions includes/fbproductfeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,12 @@ public function is_upload_complete( &$settings ) {

// Log progress in local log file and FB.
public function log_feed_progress( $msg, $object = array() ) {
WC_Facebookcommerce_Utils::fblog( $msg, $object );
$msg = empty( $object ) ? $msg : $msg . wp_json_encode( $object );
Logger::log(
$msg,
[],
$object,
array(
'should_send_log_to_meta' => false,
'should_send_log_to_meta' => true,
'should_save_log_in_woocommerce' => true,
'woocommerce_log_level' => \WC_Log_Levels::DEBUG,
)
Expand Down