@param $output
@param string $type
@param array $context
@param bool $toConsole
@param bool $toLog

@return void
426508
protected function logOutput($output, $type = 'info', $context = [], $toConsole = true, $toLog = true)
    {
        if ($toConsole) {
            $this->{$type}(' ' . $output);
        }

        $type = ($type === 'line') ? 'info' : $type;

        if ($toLog) {
            app('log')->$type($output, $context);
        }
    }
471066
private function logChange($contentType, $contentId, $newContent = null, $oldContent = null, $comment = null)
    {
        $type = $oldContent ? 'Update' : 'Insert';

        $this->loggerChange->info(
            $type . ' record',
            [
                'action'      => strtoupper($type),
                'contenttype' => $contentType,
                'id'          => $contentId,
                'new'         => $newContent ? $newContent->toArray() : null,
                'old'         => $oldContent ? $oldContent->toArray() : null,
                'comment'     => $comment,
            ]
        );
    }
821908
public function log($level, $message, array $context = array())
	{
		if ($this->verbose) {
			fwrite(
				STDOUT,
				'[' . $level . '] [' . strftime('%T %Y-%m-%d') . '] ' . $this->interpolate($message, $context) . PHP_EOL
			);
			return;
		}

		if (!($level === Psr\Log\LogLevel::INFO || $level === Psr\Log\LogLevel::DEBUG)) {
			fwrite(
				STDOUT,
				'[' . $level . '] ' . $this->interpolate($message, $context) . PHP_EOL
			);
		}
	}
639673
public function output($image_type = null, $quality = null)
    {
        $image_type = $image_type ?: $this->source_type;

        header('Content-Type: ' . image_type_to_mime_type($image_type));

        $this->save(null, $image_type, $quality);
    }
266487
public function write($level, $message, $context = null)
	{
		if (!is_string($message))
			throw new \InvalidArgumentException("Message must be a string");

		if ($this->enabled)
		{
			$record = new LogRecord();
			$record->context = $context;
			$record->message = $message;
			$record->loggerName = $this->name;
			$record->level = $level;
			$record->formatted = $this->format;

			$res = $record;
			foreach (self::$settings["parsers"] as $name => $className)
			{
				$inst = new $className($res);
				$res = $inst->parse();
			}

			foreach ($this->writers as $writer)
				$writer->handle($level, $res);
		}
	}
866303
public function setOutputType($type)
    {
        if (preg_match('/(png|gif|jpe?g|tif?f|webp)/i', $type)) {
            $this->outputType = sprintf('image/%s', strtolower($type));
            return;
        } else {
            throw new \InvalidArgumentException(sprintf('Invalid output format %s', $type));
        }
    }
480080
public function write($level, $message, array $context = array())
    {
        $context = array('__context' => $context);

        $log = $this->format($level, $message, $context);
        $this->setLastLogLine($log);
        echo $log;
    }
684722
protected function output($message, $type = self::OUTPUT_INFO)
    {
        $output = $this->getOutput();

        if ($output === null) {
            return;
        }

        // Chose color type of message
        switch ($type) {
            case self::OUTPUT_COMMENT:
                $logMethod = 'info';
                $prefix = '<comment>';
                $postfix = '</comment>';
                break;

            case self::OUTPUT_ERROR:
                $logMethod = 'critical';
                $prefix = '<error>';
                $postfix = '</error>';
                break;

            case self::OUTPUT_INFO:
            default:
                $logMethod = 'info';
                $prefix = '<info>';
                $postfix = '</info>';
                break;
        }

        $psrLogBase = self::PSR_LOG_BASE;
        $consoleBase = self::SYMFONY_CONSOLE_BASE;

        if ($output instanceof $psrLogBase) {
            $output->$logMethod($message);

        } else {
            if ($output instanceof $consoleBase) {
                $output->writeln($prefix . $message . $postfix);
            }
        }

    }
1187780
public function publishNewType(Type $toType, $newStatus)
    {
        $this->contentTypeGateway->publishTypeAndFields(
            $toType->id,
            $toType->status,
            Type::STATUS_MODIFIED
        );

        $script = \eZScheduledScript::create(
            'syncobjectattributes.php',
            \eZINI::instance('ezscriptmonitor.ini')->variable('GeneralSettings', 'PhpCliCommand') .
            ' extension/ezscriptmonitor/bin/' . \eZScheduledScript::SCRIPT_NAME_STRING .
            ' -s ' . \eZScheduledScript::SITE_ACCESS_STRING . ' --classid=' . $toType->id
        );
        $script->store();
    }
1373230
private function make_output( $assets, $type ) {

		$output = '';
	
		$output .= '<pre>' . $type . ' trovati in coda'."\r\n";
		foreach ( $assets->queue as $asset ) {

			if ( ! isset( $assets->registered[ $asset ] ) ) {
				continue;
			}

			$output .= "\r\nHandle: <strong>" . $asset . "</strong>\n";
			$output .= "<i class='small'>URL: " . $assets->registered[ $asset ]->src . "</i class='small'>\r\n";
			$deps = $assets->registered[ $asset ]->deps;
			if ( $deps ) {
				$output .= 'Dipende da >>>>>>> ';
				// $output .= print_r( $deps, true );
				foreach ( $deps as $dep ) {
					$output .= '<strong>' . $dep . '</strong>, ';
				}
				$output .= "\r\n";
			} else {
				$output .= "Non dipende da nessuno\r\n";
			}
		}
		$output .= "\r\n</pre>";

		return $output;
	}
373919
public static function print_cleaned_export($log, $instance=null) {
        global $CFG, $OUTPUT, $PAGE;
        if (empty($instance) || !$instance instanceof portfolio_plugin_base) {
            $instance = portfolio_instance($log->portfolio);
        }
        $title = get_string('exportalreadyfinished', 'portfolio');
        $PAGE->navbar->add($title);
        $PAGE->set_title($title);
        $PAGE->set_heading($title);
        echo $OUTPUT->header();
        echo $OUTPUT->notification(get_string('exportalreadyfinished', 'portfolio'));
        self::print_finish_info($log->returnurl, $instance->resolve_static_continue_url($log->continueurl));
        echo $OUTPUT->continue_button($CFG->wwwroot);
        echo $OUTPUT->footer();
        exit;
    }
1352922
public function updateContentObjects(Type $fromType, Type $toType)
    {
        $this->contentUpdater->applyUpdates(
            $fromType->id,
            $this->contentUpdater->determineActions($fromType, $toType)
        );
    }
400151
public function write($output)
    {
        //lets parse the file
        if ($this->_hasBeenModified($this->_file) || !file_exists($output)) {
            //get the data
            file_put_contents($output, $this->getData());
            //update the timestamp
            $this->_cache_data['timestamp'] = time();
            file_put_contents($this->_cache_file, serialize($this->_cache_data));
        }
    }
548035
public function log($data, $level = self::LEVEL_INFO, $type = null)
    {
        if (!is_string($data)) {
            $data = print_r($data, true);
        }

        file_put_contents(
            $this->getLogDirectory() . '/' . $this->getLogFilename(),
            $this->getLogMessage($data, $level, $type),
            FILE_APPEND
        );
    }
903001
public function log($level, $message, array $context = [])
    {
        // convert level to syslog level
        $syslogPriority = self::levelToPriority($level);

        syslog(
            $syslogPriority,
            $message
        );
    }
335078
@SuppressWarnings("unchecked")
    public void writeTo(final Output output, final Object value) throws IOException
    {
        final Schema<Object> schema = strategy.writePojoIdTo(
                output, ID_POJO, (Class<Object>)value.getClass());
        
        if(output instanceof StatefulOutput)
        {
            // update using the derived schema.
            ((StatefulOutput)output).updateLast(schema, this);
        }
        
        // write the rest of the fields of the exact type
        schema.writeTo(output, value);
    }
310495
public function log($message, $context = null, $logType = null)
    {
        if (is_int($context) and is_null($logType)) {
            $logType = $context;
            $context = array();
        }

        if (!is_array($context)) {
            $context = is_null($context) ? array() : array($context);
        }

        if (!is_int($logType)) {
            $logType = self::INFO;
        }

        return call_user_func(array($this->instance, $this->logTypes[$logType]), $message, $context);
    }