Restore remove and clear functionality to WC_Logger

Maintain backwards compatibility of removing or clearing files.
This commit is contained in:
Jon Surrell 2017-01-12 22:13:42 +01:00
parent 7b95988811
commit 78a6ed4d44
1 changed files with 10 additions and 4 deletions

View File

@ -216,11 +216,14 @@ class WC_Logger {
* *
* @deprecated 2.7.0 * @deprecated 2.7.0
* *
* @param string $handle
*
* @return bool * @return bool
*/ */
public function clear() { public function clear( $handle ) {
wc_deprecated_function( 'WC_Logger::clear', '2.7', 'WC_Log_Handler_File::clear' ); wc_deprecated_function( 'WC_Logger::clear', '2.7', 'WC_Log_Handler_File::clear' );
return false; $handler = new WC_Log_Handler_File();
return $handler->clear( $handle );
} }
/** /**
@ -228,10 +231,13 @@ class WC_Logger {
* *
* @deprecated 2.7.0 * @deprecated 2.7.0
* *
* @param string $handle
*
* @return bool * @return bool
*/ */
public function remove() { public function remove( $handle ) {
wc_deprecated_function( 'WC_Logger::remove', '2.7', 'WC_Log_Handler_File::remove' ); wc_deprecated_function( 'WC_Logger::remove', '2.7', 'WC_Log_Handler_File::remove' );
return false; $handler = new WC_Log_Handler_File();
return $handler->remove( $handle );
} }
} }