WC_Logger::add()publicWC 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.

Method of the class: WC_Logger{}

Hooks from the method

Return

true|false.

Usage

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

WC_Logger::add() code WC 9.4.2

public function add( $handle, $message, $level = WC_Log_Levels::NOTICE ) {
	$message = apply_filters( 'woocommerce_logger_add_message', $message, $handle );
	$this->log(
		$level,
		$message,
		array(
			'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;
}