WordPress at Your Fingertips
function is not described

WC_Logger::add() public WC 1.0

Add a log entry.

This is not the preferred method for adding log messages. Please use log() or any one of the level methods (debug(), info(), etc.). This method may be deprecated in the future.

{} It's a method of the class: WC_Logger{}

Hooks from the method




$WC_Logger = new WC_Logger();
$WC_Logger->add( $handle, $message, $level );
$handle(string) (required)
File handle.
$message(string) (required)
Message to log.
Logging level.
Default: WC_Log_Levels::NOTICE

Code of WC_Logger::add() WC 6.1.0

public function add( $handle, $message, $level = WC_Log_Levels::NOTICE ) {
	$message = apply_filters( 'woocommerce_logger_add_message', $message, $handle );
			'source'  => $handle,
			'_legacy' => true,
	wc_do_deprecated_action( 'woocommerce_log_add', array( $handle, $message ), '3.0', 'This action has been deprecated with no alternative.' );
	return true;