WC_Log_Handler_DB::handle( int $timestamp, string $level, string $message, array $context )

Handle a log entry.


Description Description

See also See also


Top ↑

Parameters Parameters

$timestamp

(Required) Log timestamp.

$level

(Required) emergency|alert|critical|error|warning|notice|info|debug.

$message

(Required) Log message.

$context

(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.


Top ↑

Return Return

(bool) False if value was not handled and true if value was handled.


Top ↑

Source Source

File: includes/log-handlers/class-wc-log-handler-db.php

	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 );
	}


Top ↑

User Contributed Notes User Contributed Notes

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