*/
public function __destruct() {
if ( !$this->everExecuted ) {
+ $context = [ 'command' => $this->command ];
$message = __CLASS__ . " was instantiated, but execute() was never called.";
if ( $this->method ) {
- $message .= " Calling method: {$this->method}.";
+ $message .= ' Calling method: {method}.';
+ $context['method'] = $this->method;
}
- $message .= " Command: {$this->command}";
- trigger_error( $message, E_USER_NOTICE );
+ $message .= ' Command: {command}';
+ $this->logger->warning( $message, $context );
}
}
if ( !$useLogPipe && $this->useStderr ) {
$cmd .= ' 2>&1';
}
- wfDebug( __METHOD__ . ": $cmd\n" );
+ $this->logger->debug( __METHOD__ . ": $cmd" );
// Don't try to execute commands that exceed Linux's MAX_ARG_STRLEN.
// Other platforms may be more accomodating, but we don't want to be