Skip to content

Commit

Permalink
Restore remove and clear functionality to WC_Logger
Browse files Browse the repository at this point in the history
Maintain backwards compatibility of removing or clearing files.
  • Loading branch information
sirreal committed Jan 12, 2017
1 parent 7b95988 commit 78a6ed4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions includes/class-wc-logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,22 +216,28 @@ public function debug( $message, $context = array() ) {
*
* @deprecated 2.7.0
*
* @param string $handle
*
* @return bool
*/
public function clear() {
public function clear( $handle ) {
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 );
}

/**
* Remove/delete the chosen file.
*
* @deprecated 2.7.0
*
* @param string $handle
*
* @return bool
*/
public function remove() {
public function remove( $handle ) {
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 );
}
}

0 comments on commit 78a6ed4

Please sign in to comment.