class WatchdogCommands extends DrushCommands (View source)

Traits

ProcessManagerAwareTrait
LoggerAwareTrait
IO
ConfigAwareTrait

Constants

REQ

OPT

EXIT_SUCCESS

EXIT_FAILURE

Methods

getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct()

No description

LoggerInterface
logger()

Returns a logger object.

io()

Override Robo's IO function with our custom style.

printFile(string $file)

Print the contents of a file.

RowsOfFields
show($substring = '', $options = ['format' => 'table', 'count' => 10, 'severity' => self::REQ, 'type' => self::REQ, 'extended' => false])

Show watchdog messages.

RowsOfFields
watchdogList($substring = '', $options = ['format' => 'table', 'count' => 10, 'extended' => false])

Interactively filter the watchdog message listing.

interactList($input, $output)

No description

void
delete($substring = '', $options = ['severity' => self::REQ, 'type' => self::REQ])

Delete watchdog log records.

PropertyList
showOne($id, $options = ['format' => 'yaml'])

Show one log record by ID.

An
where($type = null, $severity = null, $filter = null, $criteria = 'AND')

Build a WHERE snippet based on given parameters.

Array.
formatResult($result, $extended = false)

Format a watchdog database row.

static Array
messageTypes()

Helper function to obtain the message types based on drupal version.

Details

DrushConfig getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct()

protected LoggerInterface logger()

Returns a logger object.

Return Value

LoggerInterface

protected io()

Override Robo's IO function with our custom style.

protected printFile(string $file)

Print the contents of a file.

Parameters

string $file Full path to a file.

RowsOfFields show($substring = '', $options = ['format' => 'table', 'count' => 10, 'severity' => self::REQ, 'type' => self::REQ, 'extended' => false])

Show watchdog messages.

Parameters

$substring
$options

Return Value

RowsOfFields

RowsOfFields watchdogList($substring = '', $options = ['format' => 'table', 'count' => 10, 'extended' => false])

Interactively filter the watchdog message listing.

Parameters

$substring
$options

Return Value

RowsOfFields

interactList($input, $output)

Parameters

$input
$output

Exceptions

UserAbortException

void delete($substring = '', $options = ['severity' => self::REQ, 'type' => self::REQ])

Delete watchdog log records.

Parameters

$substring
$options

Return Value

void

PropertyList showOne($id, $options = ['format' => 'yaml'])

Show one log record by ID.

Parameters

$id
$options

Return Value

PropertyList

protected An where($type = null, $severity = null, $filter = null, $criteria = 'AND')

Build a WHERE snippet based on given parameters.

Parameters

$type String. Valid watchdog type.
$severity Int or String for a valid watchdog severity message.
$filter String. Value to filter watchdog messages by.
$criteria ('AND', 'OR'). Criteria for the WHERE snippet.

Return Value

An array with structure ('where' => string, 'args' => array())

protected Array. formatResult($result, $extended = false)

Format a watchdog database row.

Parameters

$result Array. A database result object.
$extended Boolean. Return extended message details.

Return Value

Array. The result object with some attributes themed.

static Array messageTypes()

Helper function to obtain the message types based on drupal version.

Return Value

Array of watchdog message types.