Update WC_Logger to include actions on add & clear methods

This allows for easy integrating with third party logging services.
This commit is contained in:
Patrick Garman 2015-07-10 14:26:30 -05:00
parent a01660cbba
commit fb84486798
1 changed files with 4 additions and 0 deletions

View File

@ -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 );
}
}