A convenience function for logging a error event.  It will log a
message at the PEAR_LOG_ERR log level.

PEAR_LOG_ERR

@param mixed $message	String or object containing the message to log.
@return  boolean True if the message was successfully logged.
760532
public function err( $message )
	{
		$ex = new Exception();
		echo $ex->getTraceAsString();

		if ( ! $this->log ) return;
		return $this->log->err( $message );
	}
957014
public function logFail($message, bool $separate = false): ?bool
    {
        return $this->log(self::FAIL, $message, $separate);
    }
1234016
protected function log($message)
    {
        if ($this->log_handle == null) {
            $this->log_handle = fopen($this->config['logfile'], 'a');
        }
        fwrite($this->log_handle, $message);
    }
1189578
public function error($message) {
        $message = printPretty($message, $return=true);

        $hStream = CLI ? \STDERR : fopen('php://stderr', 'a');
        fwrite($hStream, $message);
        if (!CLI) fclose($hStream);
    }
614788
private function logMessage(Message $message)
    {
        $logMessage = \sprintf(
            '%s %s (%.3Fs)',
            $message->getRequest()->getMethod(),
            (string) $message->getRequest()->getUri(),
            $message->getDuration()
        );

        // This is a "simple" log, for general purpose
        $this->logger->log(
            $message->getLogLevel(),
            $logMessage
        );

        // This is a debug log, with all message details, useful for debugging
        $this->logger->debug($logMessage, $message->jsonSerialize());
    }
143644
public function logError($message, $object = null)
    {
        $this->doLog(LogHelper::LOG_LEVEL_ERROR, $message, $object);
    }
395395
public function err($message, array $context = array())
    {
        return $this->_instance->addRecord(\Monolog\Logger::ERROR, $message, $context);
    }
1330796
public function log($message, $code = self::LOG_TYPE_INFO)
    {
        if ($this->logLevel === self::LOG_NONE) {
            return false;
        }

        /*if ($this->logger === null) {
            if ($this->logLevel === self::LOG_NORMAL && $code !== self::LOG_TYPE_DEBUG) {
                fwrite($this->logOutput, "*** " . $message['message'] . "\n");
            } else if ($this->logLevel === self::LOG_VERBOSE) {
                fwrite($this->logOutput, "** [" . strftime('%T %Y-%m-%d') . "] " . $message['message'] . "\n");
            } else {
                return false;
            }
            return true;
        } else {*/
        $extra = array();

        if (is_array($message)) {
            $extra = $message['data'];
            $message = $message['message'];
        }

        if (!isset($extra['worker'])) {
            if ($this->child > 0) {
                $extra['worker'] = $this->hostname . ':' . getmypid();
            } else {
                list($host, $pid, $queues) = explode(':', (string) $this, 3);
                $extra['worker'] = $host . ':' . $pid;
            }
        }

        if (($this->logLevel === self::LOG_NORMAL || $this->logLevel === self::LOG_VERBOSE) && $code !== self::LOG_TYPE_DEBUG) {

            if ($this->logger === null) {
                fwrite($this->logOutput, "[" . date('c') . "] " . $message . "\n");
            } else {
                switch ($code) {
                    case self::LOG_TYPE_INFO:
                        $this->logger->addInfo($message, $extra);
                        break;
                    case self::LOG_TYPE_WARNING:
                        $this->logger->addWarning($message, $extra);
                        break;
                    case self::LOG_TYPE_ERROR:
                        $this->logger->addError($message, $extra);
                        break;
                    case self::LOG_TYPE_CRITICAL:
                        $this->logger->addCritical($message, $extra);
                        break;
                    case self::LOG_TYPE_ALERT:
                        $this->logger->addAlert($message, $extra);
                }
            }



        } else if ($code === self::LOG_TYPE_DEBUG && $this->logLevel === self::LOG_VERBOSE) {
            if ($this->logger === null) {
                fwrite($this->logOutput, "[" . date('c') . "] " . $message . "\n");
            } else {
                $this->logger->addDebug($message, $extra);
            }
        } else {
            return false;
        }

         return true;
        //}
    }
892805
public function log($message)
    {
        $formattedMessage = $this->formatMessage($message);
        if (!empty($formattedMessage)) {
            $this->logger->info($formattedMessage);
        }
    }
771258
public function error($message, array $context = [])
    {
        if ($message instanceof \Throwable) {
            $m = "[{$message->getCode()}] " . $message->getMessage();
            $m .= "\n";
            $m .= $message->getTraceAsString();
            $this->error($m, $context); // calling back this method with string argument
            return;
        }

        $this->log(LogLevel::ERROR, $message, $context);
    }
593940
protected function logError($message, $severity = 0, $name = '')
    {
        if ('' == $name) {
            $this->error[] = $message;
        } else {
            $this->error[$name] = $message;
        }
        if ($severity > 0) {
            $this->logger->log($severity, $message);
        }
    }
749625
public void error(Object message)
    {
        if (IS12)
        {
            getLogger().log(FQCN, Level.ERROR, message, null);
        }
        else
        {
            getLogger().log(FQCN, Level.ERROR, message, null);
        }
    }
773890
public function notice($message)
    {
        $args = func_get_args();
        array_shift($args);
        return $this->log(Log::Notice, $message, $args);
    }
1293338
private function tryLogMessage($message)
    {
        $messageId = null;

        if ($message instanceof RemoteMessage) $messageId = $message->header()->uuid();
        elseif ($message instanceof ProcessingMessage) $messageId = $message->uuid();

        if (! $messageId) return;

        $entry = $this->messageLogger->getEntryForMessageId($messageId);

        if ($entry) return;

        $this->messageLogger->logIncomingMessage($message);
    }
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";
            }
        }
    }
40961
public function logWarn($message, bool $separate = false): ?bool
    {
        return $this->log(self::WARN, $message, $separate);
    }
255470
protected function error($message)
    {
        if ($this->output instanceof ConsoleOutputInterface) {
            $this->output->getErrorOutput()->writeln("<error>$message</error>");
        } else {
            $this->output->writeln("<error>$message</error>");
        }
    }