WC_Logger::add( string $handle, string $message, string $level = WC_Log_Levels::NOTICE )

Add a log entry.

Description Description

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.

Parameters Parameters


(Required) File handle.


(Required) Message to log.


(Optional) Logging level.

Default value: WC_Log_Levels::NOTICE

Top ↑

Return Return


Top ↑

Source Source

File: includes/class-wc-logger.php

	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;

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.