Logs errors

@param $message
@return string
967898
public function logError($message)
    {
        if (func_num_args() > 1) {
            $message = $this->_prepareLogMessage(func_get_args());
        }

        return $this->_log(Zend_Log::ERR, $message);
    }
1355523
public function logError(string $message = '', ?string $source = null, ?string $exception = null): bool
    {
        $ret = false;
        if ($this->logLevel & Log::LOG_ERROR) {
            $ret = $this->rawLog('[  ERROR]', $message, $source, $exception);
        }
        return $ret;
    }
1147777
protected function log($message)
    {
        if (method_exists($this->io, 'writeError')) {
            $this->io->writeError($message);
        }
        else {
            // @codeCoverageIgnoreStart
            $this->io->write($message);
            // @codeCoverageIgnoreEn
        }
    }
542642
protected function _log($type='error', $message)
	{
		if (!$message)
		{
			return;
		}

		if (\App::get('config')->get('debug'))
		{
			$message = '[' . \App::get('request')->getVar('REQUEST_URI', '', 'server') . '] [' . $message . ']';
		}

		$type = strtolower($type);
		if (!in_array($type, array('error', 'debug', 'critical', 'warning', 'notice', 'alert', 'emergency', 'info')))
		{
			return;
		}

		$logger = \Log::getRoot();
		$logger->$type($message);
	}
1262182
public static function formatMessage($message): string
    {
        if ($message instanceof \Throwable) {
            while ($message) {
                $tmp[] = ($message instanceof \ErrorException
                        ? Helpers::errorTypeToString($message->getSeverity()) . ': ' . $message->getMessage()
                        : Helpers::getClass($message) . ': ' . $message->getMessage() . ($message->getCode() ? ' #' . $message->getCode() : '')
                    ) . ' in ' . $message->getFile() . ':' . $message->getLine();
                $message = $message->getPrevious();
            }
            $message = \implode("\ncaused by ", $tmp);

        } elseif (!\is_string($message)) {
            $message = self::toText($message);
        }

        return \trim($message);
    }
320590
public function log($message)
    {
        $messages = (array) $message;
        foreach ($messages as $message) {
            $this->getLogger()->info($this->prependHandle($message));
        }
    }
121376
public function error($message = 'Unknown Error')
    {
        $format = config('api.errorFormat');

        if ($message instanceof \Exception) {
            if (config('api.debug') === true) {
                $format['debug'] = [
                    'line' => $message->getLine(),
                    'file' => $message->getFile(),
                    'class' => get_class($message),
                    'trace' => explode("\n", $message->getTraceAsString()),
                ];
            }

            $this->statusCode = $this->translateExceptionCode($message);
            $message = $message->getMessage();
        }

        return $this->respond(
            $this->format($message, $format)
        );
    }
51572
protected function get_error_message($message = null) {
        global $OUTPUT;

        if (empty($message)) {
            $message = get_string('apierror', 'block_tag_youtube');
        }
        return $OUTPUT->notification($message);
    }
614016
protected function logToFile($message){
        if(isset($this->logger) && $this->logger instanceof \sb\Logger\Base){
            return $this->logger->{$this->log_name}($message);
        }
    }
67090
public function info($message)
    {
        $args = func_get_args();
        array_shift($args);
        return $this->log(Log::Info, $message, $args);
    }
876267
protected function writeToFile($message)
    {
        $message = $message . PHP_EOL;
        return @file_put_contents($this->logFile, $message, FILE_APPEND);
    }
277266
public function log($level, $message, array $context = array())
    {
        return error_log(self::PREFIX.' '.strtoupper($level).': '.$message.' '.
            (!empty($context) ? print_r($context, true) : ''));
    }
869926
public function errors(array $messages): string
    {
        if (!$messages) {
            return ''; // No error messages.
        }
        $messages      = $this->c::markdown($messages, ['no_p' => true]);
        return $markup = '<ul><li>'.implode('</li><li>', $messages).'</li></ul>';
    }
1367224
protected static function outputCliError($message)
    {
        $application = new ConsoleApp();
        $output = new ConsoleOutput();
        $application->renderException(new ResponseException($message), $output);
    }
203237
public function debug($message)
    {
        $args = func_get_args();
        array_shift($args);
        return $this->log(Log::Debug, $message, $args);
    }
909255
private function logException($message, $exception)
    {
        return $this->app['logger.system']->error(
            $message . ': ' . $exception->getMessage(),
            ['event' => 'exception', 'exception' => $exception]
        );
    }
45173
public static function errorLog(string $message, \Exception $exception)
    {
        $logger = Config::getLogger();
        if ($logger) {
            $logger->error($message, ['exception' => $exception]);
        }
    }