wc_register_default_log_handler

Registers the default log handler.

Description

(array) wc_register_default_log_handler( (array) $handlers ); 

Returns (array)

Parameters (1)

0. $handlers (array)
The handlers.

Usage

  1. if ( !function_exists( 'wc_register_default_log_handler' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php'; 
  3.  
  4. // The handlers. 
  5. $handlers = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_register_default_log_handler($handlers); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-core-functions.php  
  1. function wc_register_default_log_handler( $handlers ) { 
  2.  
  3. if ( defined( WC_LOG_HANDLER ) && class_exists(WC_LOG_HANDLER) ) { 
  4. $handler_class = WC_LOG_HANDLER; 
  5. $default_handler = new $handler_class(); 
  6. } else { 
  7. $default_handler = new WC_Log_Handler_File(); 
  8.  
  9. array_push( $handlers, $default_handler ); 
  10.  
  11. return $handlers;