WordPress at Your Fingertips
function is not described

WC_Log_Handler_DB::handle() public WC 1.0

Handle a log entry.

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

No Hooks.

Return

true|false. False if value was not handled and true if value was handled.

Usage

$WC_Log_Handler_DB = new WC_Log_Handler_DB();
$WC_Log_Handler_DB->handle( $timestamp, $level, $message, $context );
$timestamp(int) (required)
Log timestamp.
$level(string) (required)
emergency|alert|critical|error|warning|notice|info|debug.
$message(string) (required)
Log message.
$context(array) (required)

Additional information for log handlers.

  • source(string)
    Optional. Source will be available in log table. If no source is provided, attempt to provide sensible default.

Notes

Code of WC_Log_Handler_DB::handle() WC 5.8.0

public function handle( $timestamp, $level, $message, $context ) {

	if ( isset( $context['source'] ) && $context['source'] ) {
		$source = $context['source'];
	} else {
		$source = $this->get_log_source();
	}

	return $this->add( $timestamp, $level, $message, $source, $context );
}