WordPress at Your Fingertips
function is not described

WC_Log_Handler_File::add() protected WC 1.0

Add a log entry to chosen file.

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

No Hooks.

Return

true|false. True if write was successful.

Usage

// protected - for code of main (parent) or child class
$result = $this->add( $entry, $handle );
$entry(string) (required)
Log entry text.
$handle(string) (required)
Log entry handle.

Code of WC_Log_Handler_File::add() WC 5.8.0

protected function add( $entry, $handle ) {
	$result = false;

	if ( $this->should_rotate( $handle ) ) {
		$this->log_rotate( $handle );
	}

	if ( $this->open( $handle ) && is_resource( $this->handles[ $handle ] ) ) {
		$result = fwrite( $this->handles[ $handle ], $entry . PHP_EOL ); // @codingStandardsIgnoreLine.
	} else {
		$this->cache_log( $entry, $handle );
	}

	return false !== $result;
}