Properties

$logger

$logger : null|self

Instance.

Type

normal

Methods

instance()

instance() : \ActionScheduler_Logger

Get instance.

Returns

\ActionScheduler_Logger

log()

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

Add a record to an action log.

Parameters

int $action_id

Action ID.

string $message

Message to be saved in the log entry.

\DateTime|null $date

Timestamp of the log entry.

Returns

int —

The log entry ID.

get_entry()

get_entry(int  $entry_id) : \ActionScheduler_LogEntry

Retrieve an action log entry.

Parameters

int $entry_id

Log entry ID.

Returns

\ActionScheduler_LogEntry

get_logs()

get_logs(int  $action_id) : \ActionScheduler_LogEntry[]

Retrieve an action's log entries from the database.

Parameters

int $action_id

Action ID.

Returns

\ActionScheduler_LogEntry[]

init()

init() : mixed

Initialize the data store.

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

clear_deleted_action_logs()

clear_deleted_action_logs(int  $action_id) : mixed

Delete the action logs for an action.

Parameters

int $action_id

Action ID.

Returns

mixed

create_entry_from_db_record()

create_entry_from_db_record(object  $record) : \ActionScheduler_LogEntry

Create an action log entry from a database record.

Parameters

object $record

Log entry database record object.

Returns

\ActionScheduler_LogEntry