class WatchdogCommands extends DrushCommands (View source)

Traits

ProcessManagerAwareTrait
LoggerAwareTrait
IO
ConfigAwareTrait

Constants

REQ

OPT

EXIT_SUCCESS

EXIT_FAILURE

EXIT_FAILURE_WITH_CLARITY

Properties

protected CommandData $commandData from  DrushCommands

Methods

getConfig()

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

__construct()

No description

io()

Override Robo's IO function with our custom style.

LoggerInterface
logger()

Returns a logger object.

printFile(string $file)

Print the contents of a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

HandlerStack
getStack()

Get a Guzzle handler stack that uses the Drush logger.

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.

formatResult($result, $extended = false)

No description

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 io()

Override Robo's IO function with our custom style.

protected LoggerInterface logger()

Returns a logger object.

Return Value

LoggerInterface

protected printFile(string $file)

Print the contents of a file.

Parameters

string $file Full path to a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

Parameters

CommandData $commandData

protected printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

Parameters

CommandData $commandData Full path to a file.

protected HandlerStack getStack()

Get a Guzzle handler stack that uses the Drush logger.

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 Valid watchdog type.
$severity or String for a valid watchdog severity message.
$filter Value to filter watchdog messages by.
$criteria 'OR'). Criteria for the WHERE snippet.

Return Value

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

protected formatResult($result, $extended = false)

Parameters

$result
$extended

static array messageTypes()

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

Return Value

array of watchdog message types.