Logs being recorded even with debug option disabled
-
Hi,
There is a message spamming my logs, even with the debug option being disabled in the plugin config.
It comes from:
facebook-for-woocommerce\includes\Handlers\Connection.phpLine 394: private function retrieve_page_access_token( $page_id )
One of them is:
facebook_for_woocommerce()->log( ‘Retrieving page access token’ );What I saw is that the log function has not been overridden to check the debug option as it’s done in the similar function log_api_request.
Please, to fix that, include the following piece of code in the file:
facebook-for-woocommerce\class-wc-facebookcommerce.php/** * Saves errors or messages to WooCommerce Log (woocommerce/logs/plugin-id-xxx.txt) * * @since 2.0.0 * @param string $message error or message to save to log * @param string $log_id optional log id to segment the files by, defaults to plugin id */ public function log( $message, $log_id = null ) { // bail if logging isn't enabled if ( ! $this->get_integration() || ! $this->get_integration()->is_debug_mode_enabled() ) { return; } parent::log( $message, $log_id ); }
Hopefully it can make the next release.
It’s annoying the need to keep cleaning up my logs if I chose to not log anything from this plugin.
- The topic ‘Logs being recorded even with debug option disabled’ is closed to new replies.