Automattic\WooCommerce\Blueprint

Logger::logpublicWC 1.0

Log a message as a debug log entry.

Method of the class: Logger{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Logger = new Logger();
$Logger->log( $message, $level, $context );
$message(string) (required)
The message to log.
$level(string)
The log level.
Default: \WC_Log_Levels::DEBUG
$context(array)
The context of the log.
Default: array()

Logger::log() code WC 9.9.5

public function log( string $message, string $level = \WC_Log_Levels::DEBUG, $context = array() ) {
	$this->logger->log(
		$level,
		$message,
		array_merge(
			array(
				'source'  => 'wc-blueprint',
				'user_id' => $this->wp_get_current_user_id(),
			),
			$context
		)
	);
}