According to context, logs specified error into STDERR, STDOUT or via error_log().

@param mixed $mError Error to log. Can be string, array or object.
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);
        }
    }
274226
public function phpErrorHandler($errno, $errstr, $errfile, $errline) {
		foreach($this->ignoreDirs as $dir) {
			if(strpos($errfile, $dir) === 0)
				return;
		}

		if($this->isLogging() && $this->logPHPErrors)
			$this->log(\Psr\Log\LogLevel::NOTICE, 'PHP ('.static::getPHPError($errno).'): '.$errstr, $errfile, $errline);
		throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
	}
570138
def log(self, msg, error=False):
        """"""
        output = self.stdout
        if error:
            output = self.stderr

        output.write(msg)
        output.write('\n')
871995
function logError( $message, array $more_info = [] ) {

		$more_info['path'] = $this->outputPath;

		parent::logError( $message, $more_info );
	}
884853
public function error($line, $eol = PHP_EOL)
    {
        fwrite(STDERR, $line . $eol);
        fflush(STDERR);
    }
987156
function(errMsg, err) {
      this.newline();
      doLog('*******************************************************************');
      doLog('* ERROR                                                           *');
      doLog('*******************************************************************');

      if (generalUtils.isEmpty(err)) {
        doLog(errMsg);
      } else {
        doLogError(errMsg, err);
      }
      this.newline();
    }
501112
protected function errorStop($use) {
    foreach (libxml_get_errors() as $error) {
      switch ($error->level) {
        case LIBXML_ERR_WARNING:
        case LIBXML_ERR_ERROR:
          $level = LogLevel::WARNING;
          break;

        case LIBXML_ERR_FATAL:
          $level = LogLevel::ERROR;
          break;

        default:
          $level = LogLevel::INFO;
      }

      $this->log($level, '%error on line %num. Error code: %code.', array(
        '%error' => trim($error->message),
        '%num' => $error->line,
        '%code' => $error->code,
      ));
    }
    libxml_clear_errors();
    libxml_use_internal_errors($use);
  }
775453
public function error($message): void
	{
		$message = $this->logMessToArray($message);
		$this->log(array_merge(['SEVERITY' => 'ERROR'], $message));
	}
1256010
public function error(
        $msg,
        array $args = array(),
        \Exception $exception = null
    ) {
        return $this->log(\Plop\ERROR, $msg, $args, $exception);
    }
713749
protected function catchError($error){
        if($this->connection->inTransaction()){
            $this->errorTran[]= $error;
            $this->stateTran= FALSE;
        }
        $this->lastError= $error;    
        
    }
90001
private function logError($errno, $errstr, $errfile, $errline)
    {
        if (!($errno & $this->loggedErrors)) {
            return false;
        }

        $loggedLevel = isset($this->logLevels[$errno]) ? $this->logLevels[$errno] : 'error';

        $stacktrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
        $stacktrace = array_slice($stacktrace, 2);

        array_unshift($stacktrace, [
            'file' => $errfile,
            'line' => $errline,
        ]);

        $this->logger->log($loggedLevel, $errstr, [
            'errorCode' => $errno,
            'errorType' => self::getErrorType($errno),
            'errorFile' => $errfile,
            'errorLine' => $errline,
            'errorStacktrace' => $this->formatStacktrace($stacktrace),
        ]);

        return true;
    }
65577
protected function handleError($response) {
    $errorMsg = $response->getValue('errorMsg');
    self::$logger->error("Error in remote call to ".$this->serverCli.": ".$errorMsg."\n".$response->toString());
    throw new \RuntimeException("Error in remote call to ".$this->serverCli.": ".$errorMsg);
  }
143644
public function logError($message, $object = null)
    {
        $this->doLog(LogHelper::LOG_LEVEL_ERROR, $message, $object);
    }
576255
protected function logError($message)
    {
        if ($this->logger instanceof LoggerInterface) {
            $this->logger->error($message);
        } else {
            error_log($message);
        }
    }
276454
static public function errorHandler($errno, $errstr, $errfile='', $errline=0, $errcontext=array())
    {
        if (!isset(self::$ignore[basename($errfile) . '-' . $errline . '-' . $errno])) {
            $msg = $errstr . ' Line '
                    . $errline
                    . ', '
                    . $errfile;
            self::$logger->debug($msg);
        }

        return true;
    }
1048344
protected function log_error($errors) {
        if (empty($errors)) {
            return;
        }

        foreach ($errors as $code => $langstring) {
            if (!isset($this->errors[$this->linenb])) {
                $this->errors[$this->linenb] = array();
            }
            $this->errors[$this->linenb][$code] = $langstring;
        }
    }
577115
public function useErrorLog($level = 'debug', $messageType = ErrorLogHandler::OPERATING_SYSTEM)
    {
        $this->monolog->pushHandler(
            $handler = new ErrorLogHandler($messageType, $this->parseLevel($level))
        );

        $handler->setFormatter($this->getDefaultFormatter());
    }