Ejemplo n.º 1
0
 /**
  * Adds a logg message using the level defined in the mappings.
  *
  * @param \AnsibleWrapper\Event\AnsibleEvent $event
  * @param string $message
  * @param array $context
  *
  * @throws \DomainException
  */
 public function log(AnsibleEvent $event, $message, array $context = array())
 {
     $method = $this->getLogLevelMapping($event->getName());
     if ($method !== false) {
         $context += array('command' => $event->getProcess()->getCommandLine());
         $this->logger->{$method}($message, $context);
     }
 }
Ejemplo n.º 2
0
 /**
  * Constructs a AnsibleEvent object.
  *
  * @param \AnsibleWrapper\AnsibleWrapper $wrapper
  *   The AnsibleWrapper object that likely instantiated this class.
  * @param \Symfony\Component\Process\Process $process
  *   The Process object being run.
  * @param \AnsibleWrapper\AnsibleCommand $command
  *   The AnsibleCommand object being executed.
  */
 public function __construct(AnsibleWrapper $wrapper, Process $process, AnsibleCommand $command, $type, $buffer)
 {
     parent::__construct($wrapper, $process, $command);
     $this->type = $type;
     $this->buffer = $buffer;
 }