Joli\JoliCi\LoggerCallback::buildCallback PHP Method

buildCallback() private method

The build callback when creating a image, useful to see what happens during building
private buildCallback ( Docker\API\Model\BuildInfo $output )
$output Docker\API\Model\BuildInfo An encoded json string from docker daemon
    private function buildCallback(BuildInfo $output)
    {
        $message = "";
        if ($output->getError()) {
            $this->logger->error(sprintf("Error when creating job: %s\n", $output->getError()), array('static' => false, 'static-id' => null));
            return;
        }
        if ($output->getStream()) {
            $message = $output->getStream();
        }
        if ($output->getStatus()) {
            $message = $output->getStatus();
            if ($output->getProgress()) {
                $message .= " " . $output->getProgress();
            }
        }
        // Force new line
        if (!$output->getId() && !preg_match('#\\n#', $message)) {
            $message .= "\n";
        }
        $this->logger->debug($message, array('static' => $output->getId() !== null, 'static-id' => $output->getId()));
    }