Log an error message

@param   string  $message  Message type to log
@param   string  $message  Message to log
@return  void
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);
	}
876555
public function logMessage(Message $message): void
    {
        if (in_array($message->getLevel(), $this->config['log'])) {
            if ($this->getMessageFunction !== null) {
                $line = call_user_func($this->getMessageFunction, $message);
            } else {
                $time = $message->getTime()->format('y-m-d H:i:s.v');
                $level = strtoupper($message->getLevel());
                $space = str_repeat(' ', 10 - strlen($level));
                $who = $message->getWho() ?? Log::getWho();
                $line = "{$time} {$level}{$space}{$who}\t{$message->getMessage()}\n";
            }

            if (is_string($line)) {
                print $line;
            }
        }
    }
1140322
public function error(string $message, array $context = []){
        if($this->logger !== null){
            $this->logger->error($message, $context);
        }

        if($this->messagePanel !== null){
            $this->messagePanel->addMessage($message, LogLevel::ERROR);
        }
    }
1211719
public void error(Object message) {
        doLog(Level.ERROR, FQCN, message, null, null);
    }
536929
public static function error($message, $context = [], $channel = 'tastphp.logger')
    {
        $logger = static::getLoggerByLevelAndChannel(Monolog::ERROR, $channel);
        $logger->addError($message, $context);
    }
356322
final protected function error($message, $status = null, $nl = true)
    {
        $this->io->error($message, $status, $nl);
    }
1234610
private function log($message)
    {
        if (!is_null($this->logger)) {
            $this->logger->log(
                LogLevel::DEBUG,
                sprintf("[%s] - %s", date('Y-m-d H:i:s'), $message)
            );
        }
    }
441040
public function _log($message)
    {
        ee()->load->library('logger');
        ee()->load->library('user_agent');

        ee()->logger->developer($this->package.' - '.$message);
    }
727860
public static function error_log_wrap($message)
  {
    // msglen is the remain length of the message that needs to be written.
    $msglen=strlen($message);
    $i=0;
    while($msglen>0){
      if($msglen>8000){
        // the remaining message that needs to be written is still longer than 8000 bytes
        // so error_log only a chunk (start at offset: number of itereations * 8000)
        error_log(substr($message,$i*8000,8000));
        $msglen=$msglen-8000;
      }else{
        // less than 8000 bytes left, write the remainder (end)
        error_log(substr($message,$i*8000));
        $msglen=0;
      }
      $i++;
    }
  }
45173
public static function errorLog(string $message, \Exception $exception)
    {
        $logger = Config::getLogger();
        if ($logger) {
            $logger->error($message, ['exception' => $exception]);
        }
    }
397805
public function log($message)
    {
        if (null !== $this->logger) {
            $logger = $this->logger;
            $logger($message);
        }
    }
1026847
public function error($message = '', $context = [], $role = 'system', $times = 0, $ttl = 0)
    {
        if ($this->isSingle()) {
            $this->log($message, $context, Logger::ERROR, $role, $times, $ttl);
        }
    }
749625
public void error(Object message)
    {
        if (IS12)
        {
            getLogger().log(FQCN, Level.ERROR, message, null);
        }
        else
        {
            getLogger().log(FQCN, Level.ERROR, message, null);
        }
    }
65458
protected function debug($message)
    {
        if ($this->debug) {
            if ($this->debug_handler) {
                call_user_func_array(
                    $this->debug_handler, array(&$this, $message)
                );
            } else {
                echo "DEBUG: $message\n";
            }
        }
    }
215192
public function error($type, $message)
    {    
        $error = array(
            E_WARNING      => 'Warning',
            E_NOTICE       => 'Notice',
            E_USER_ERROR   => 'Error',
            E_USER_WARNING => 'Warning',
            E_USER_NOTICE  => 'Notice',
        );

        if (isset($error[$type])) {
            $this->error[] = $error[$type].': '.$message;
        }

        return true;
    }
680370
void logError(final String message) {
      if(logger != null) {
         try {
            StringBuilder buf = new StringBuilder(name);
            buf.append(":");
            buf.append(message);
            logger.error(buf.toString());            
         } catch(Throwable t) {
            //Ignore - logging should not kill anything
         }
      }
   }
795375
public static function writeError($message = null, $padding = null)
    {
        if ($padding > 0) {
            $message = str_pad($message, $padding, ' ');
        }

        self::stdError($message);
    }