Error logger

@return void
964164
public function errorLogger()
    {
        switch ($this->commMethod) {
            case 'liveupdate':
                $orderId = $this->formData['ORDER_REF'];
                $type = "LiveUpdate";
                break;
            case 'backref':
                $orderId = $this->order_ref;
                $type = "BackRef";
                break;
            case 'ios':
                $orderId = $this->orderNumber;
                $type = "IOS";
                break;
            case 'ipn':
                $orderId = @$this->postData['REFNOEXT'];
                $type = "IPN";
                break;
            case 'idn':
                $orderId = $this->refnoext;
                $type = "IDN";
                break;
            case 'irn':
                $orderId = $this->refnoext;
                $type = "IRN";
                break;
            case 'timeout':
                $orderId = $this->order_ref;
                $type = "TIMEOUT";
                break;
            case 'oneclick':
                $orderId = $this->formData['EXTERNAL_REF'];
                $type = "OneClick";
                break;
            case 'alu':
                $orderId = $this->formData['ORDER_REF'];
                $type = "ALU";
                break;

            default:
                $orderId = 'EMPTY';
                $type = 'general';
                $this->debugMessage[] = 'DEBUG_LOGGER_UNDEFINED_ID: ' . $orderId;
                $this->debugMessage[] = 'DEBUG_LOGGER_UNDEFINED_TYPE: ' . $type;
                break;
        }

        $errorCounter = count($this->errorMessage);

        $log = array();
        if ($this->debug || $errorCounter > 0) {
            $counter = 1;
            foreach ($this->debugMessage as $item) {
                $log['ITEM_' . $counter] = $item;
                $counter++;
            }
            $this->logFunc($type . '_DEBUG', $log, $orderId);
        }

        $log = array();
        if ($errorCounter > 0) {
            $counter = 1;
            foreach ($this->errorMessage as $item) {
                $log['ITEM_' . $counter] = $item;
                $counter++;
            }
            $this->logFunc($type . '_ERROR', $log, $orderId);
        }
    }
615455
public function errorLog($type = 'debug', $messageType = ErrorLogHandler::OPERATING_SYSTEM)
    {
        $this->pushHandler(new ErrorLogHandler($messageType, $this->getLevel($type)));
    }
355126
public function log($mError)
    {
        if (is_array($mError) || (is_object($mError) && ! ($mError instanceof \Exception))) {
            $mError = print_r($mError, true);
        }

        if ($this->aConfig['display_errors']) {
            if ($this->bIsRunningFromCLI) {
                file_put_contents('php://stderr', $mError . "\n", E_USER_ERROR);
            } else {
                echo '<div class="' . $this->aConfig['error_div_class'] . '">' . $mError . '</div>';
            }
        }

        if (! empty($this->aConfig['error_log_path'])) {
            error_log($mError);
        }
    }
1003190
public static function error(...$messages): void
    {
        static::init();

        if (!static::isTemporaryDisabled('error')) {
            foreach (static::$adapters as $adapter) {
                /* @var $adapter \Koldy\Log\Adapter\AbstractLogAdapter */
                if ($adapter->isLevelEnabled(self::ERROR)) {
                    $adapter->error((new Message(self::ERROR))->setMessages($messages));
                }
            }
        }
    }
1179722
public function handleFatalError()
    {
        unset($this->_memoryReserve);

        // load ErrorException manually here because autoloading them will not work
        // when error occurs while autoloading a class
        if (!class_exists(ErrorException::class, false)) {
            require_once __DIR__ . '/../exceptions/ErrorException.php';
        }

        $error = error_get_last();

        if (ErrorException::isFatalError($error)) {
            $exception = new ErrorException($error['message'], $error['type'], $error['type'], $error['file'], $error['line']);
            $this->exception = $exception;

            $this->logException($exception);

            if ($this->discardExistingOutput) {
                $this->clearOutput();
            }
            $this->renderException($exception);

            // need to explicitly flush logs because exit() next will terminate the app immediately
            $this->profiler->flush();
            $this->flushLogger();
            exit(1);
        }
    }
1252259
def error(message = nil, &block)
      logger.add(Logger::ERROR, message, self.logging_prefix, &block)
    end
596154
function error($msg, $section = 'bors', $trace = false, $extra = array())
	{
		static $entered = false;
		if($entered)
			throw new Exception('Reentered logger with '.$msg.' in section '.$section);

		$entered = true;

		try
		{
			$this->logger($section, Logger::ERROR, $trace)->addError($msg, $extra);
		}
		catch(Exception $e)
		{
			echo "Exception while error logging:\n<code><xmp>".$e->getMessage()."</xmp></code>\nFirst error is:\n<xmp>$msg\nin".bors_debug::trace()."</xmp>";
		}

		$entered = false;
	}
1276555
public function logErrorException(\Exception $e)
    {
        if ($this->getServerContext()->hasLogger(LoggerUtils::SYSTEM)) {
            $this->getServerContext()->getLogger(LoggerUtils::SYSTEM)->error($e->__toString());
        }
    }
157496
protected function activateWarningLogger()
    {
        $this->previousErrorHandler = set_error_handler(
            array($this, "warningHandler"),
            E_WARNING | E_USER_WARNING | E_NOTICE | E_USER_NOTICE | E_USER_ERROR
        );
    }
1063042
protected static function logError(self $e): void
    {
        if (class_exists('\Osf\Log\LogProxy')) {
            $msg = get_class($e) . ' : ' . $e->getMessage();
            try {
                \Osf\Log\LogProxy::log($msg, $e->getLogLevel(), 'PHPERR', $e->getTraceAsString());
            } catch (\Exception $ex) {
                file_put_contents(sys_get_temp_dir() . '/undisplayed-sma-errors.log', date('Ymd-His-') . $ex->getMessage(), FILE_APPEND);
            }
        }
    }
704188
protected function defineErrorHandler()
    {
        $errorRender = $this->obtainErrorRender();
        
        //If not render to use
        if ($errorRender === false) {
            return;
        }

        //add the handler for errors
        set_error_handler([$this, 'errorHandler']);
        
        \BFW\Application::getInstance()
            ->getMonolog()
            ->getLogger()
            ->debug('New error handler defined.')
        ;
    }
1065674
private function createErrorHandler()
    {
        /**
         * @param int $errno
         * @param string $errstr
         * @param string $errfile
         * @param int $errline
         * @return void
         * @throws \ErrorException if error is not within the error_reporting mask.
         */
        return function ($errno, $errstr, $errfile, $errline) {
            if (! (error_reporting() & $errno)) {
                // error_reporting does not include this error
                return;
            }

            throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
        };
    }
766318
public static function error_log($errn,$errstr,$file,$line,$context){
		LogMaster::log($errstr." at ".$file." line ".$line);
	}
638403
function error (out, desc) {
  logger.error(header())
  if (desc) {
    logger.error(desc)
  }
  logger.error(out)
  logger.error()
}
217519
function logError(terminal: Terminal, format: string, ...args: Array<mixed>): void {
  const str = util.format(format, ...args);
  terminal.log('%s: %s', chalk.red('error'), str);
}
1169914
public static void logError(final Logger logger, final Error e)
	{
		logger.logError(Level.ERROR, "Unexpected Error", e);
	}
10512
public function setSilentErrorHandler() {

        set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) {
            if (0 === error_reporting()) {
                return false;
            }

            if($this->logger != null) {
                // logging all warnings & notices
                $this->getLogger()->log($errstr, Logger::CRITICAL);
            }
        });
    }