Properties

$logger

$logger : null|self

Instance.

Type

normal

Methods

instance()

instance() : \ActionScheduler_Logger

Get instance.

Returns

\ActionScheduler_Logger

log()

log(string  $action_id, string  $message, \DateTime|null  $date = null) : string

Create log entry.

Parameters

string $action_id

Action ID.

string $message

Log message.

\DateTime|null $date

Log date.

Returns

string —

The log entry ID

get_entry()

get_entry(string  $entry_id) : \ActionScheduler_LogEntry

Get action's log entry.

Parameters

string $entry_id

Entry ID.

Returns

\ActionScheduler_LogEntry

get_logs()

get_logs(string  $action_id) : \ActionScheduler_LogEntry[]

Get action's logs.

Parameters

string $action_id

Action ID.

Returns

\ActionScheduler_LogEntry[]

init()

init() : mixed

Initialize.

Returns

mixed

hook_stored_action()

hook_stored_action() : mixed

Register callback for storing action.

Returns

mixed

unhook_stored_action()

unhook_stored_action() : mixed

Unhook callback for storing action.

Returns

mixed

log_stored_action()

log_stored_action(int  $action_id) : mixed

Log action stored.

Parameters

int $action_id

Action ID.

Returns

mixed

log_canceled_action()

log_canceled_action(int  $action_id) : mixed

Log action cancellation.

Parameters

int $action_id

Action ID.

Returns

mixed

log_started_action()

log_started_action(int  $action_id, string  $context = '') : mixed

Log action start.

Parameters

int $action_id

Action ID.

string $context

Action execution context.

Returns

mixed

log_completed_action()

log_completed_action(int  $action_id, null|\ActionScheduler_Action  $action = null, string  $context = '') : mixed

Log action completion.

Parameters

int $action_id

Action ID.

null|\ActionScheduler_Action $action

Action.

string $context

Action execution context.

Returns

mixed

log_failed_action()

log_failed_action(int  $action_id, \Exception  $exception, string  $context = '') : mixed

Log action failure.

Parameters

int $action_id

Action ID.

\Exception $exception

Exception.

string $context

Action execution context.

Returns

mixed

log_timed_out_action()

log_timed_out_action(int  $action_id, string  $timeout) : mixed

Log action timeout.

Parameters

int $action_id

Action ID.

string $timeout

Timeout.

Returns

mixed

log_unexpected_shutdown()

log_unexpected_shutdown(int  $action_id, array  $error) : mixed

Log unexpected shutdown.

Parameters

int $action_id

Action ID.

array $error

Error.

Returns

mixed

log_reset_action()

log_reset_action(int  $action_id) : mixed

Log action reset.

Parameters

int $action_id

Action ID.

Returns

mixed

log_ignored_action()

log_ignored_action(int  $action_id, string  $context = '') : mixed

Log ignored action.

Parameters

int $action_id

Action ID.

string $context

Action execution context.

Returns

mixed

log_failed_fetch_action()

log_failed_fetch_action(string  $action_id, null|\Exception  $exception = null) : mixed

Log the failure of fetching the action.

Parameters

string $action_id

Action ID.

null|\Exception $exception

The exception which occurred when fetching the action. NULL by default for backward compatibility.

Returns

mixed

log_failed_schedule_next_instance()

log_failed_schedule_next_instance(int  $action_id, \Exception  $exception) : mixed

Log the failure of scheduling the action's next instance.

Parameters

int $action_id

Action ID.

\Exception $exception

Exception object.

Returns

mixed

bulk_log_cancel_actions()

bulk_log_cancel_actions(array  $action_ids) : mixed

Bulk add cancel action log entries.

Implemented here for backward compatibility. Should be implemented in parent loggers for more performant bulk logging.

Parameters

array $action_ids

List of action ID.

Returns

mixed