From fb844867980d5435fef95bde2bd043f155bdceae Mon Sep 17 00:00:00 2001 From: Patrick Garman Date: Fri, 10 Jul 2015 14:26:30 -0500 Subject: [PATCH] Update WC_Logger to include actions on add & clear methods This allows for easy integrating with third party logging services. --- includes/class-wc-logger.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/class-wc-logger.php b/includes/class-wc-logger.php index 0898e4909bb..1068afc4404 100644 --- a/includes/class-wc-logger.php +++ b/includes/class-wc-logger.php @@ -73,6 +73,8 @@ class WC_Logger { $time = date_i18n( 'm-d-Y @ H:i:s -' ); // Grab Time @fwrite( $this->_handles[ $handle ], $time . " " . $message . "\n" ); } + + do_action( 'woocommerce_log_add', $handle, $message ); } @@ -87,6 +89,8 @@ class WC_Logger { if ( $this->open( $handle ) && is_resource( $this->_handles[ $handle ] ) ) { @ftruncate( $this->_handles[ $handle ], 0 ); } + + do_action( 'woocommerce_log_clear', $handle ); } }