Echo an error iff PHPs settings allow error reporting, at the level of
errors given, and PHPs display_errors setting is on. Will return `true`
if an error is echoed, `false` otherwise.

@param int $level
@param string $message
@return bool
192501
private function errorHandler($level, $message)
    {
        Types::assert(
            ['int' => [$level], 'string' => [$message]]
        );

        if (error_reporting() & $level
            and (strtolower(ini_get('display_errors')) === 'on'
            and ini_get('display_errors'))
        ) {
            if ($level === E_USER_NOTICE)
            {
                $error = '<strong>Notice:</strong> ' .$message. "<br><br>\n\n";
            }
            elseif ($level === E_USER_WARNING)
            {
                $error = '<strong>Warning:</strong> ' .$message. "<br><br>\n\n";
            }

            if (isset($error))
            {
                echo $error;
                $this->errorString .= $error;
                return true;
            }
        }
        return false;
    }
1293210
public function log($level, $message, array $context = [])
    {
        if ( ! in_array($level, $this->threshold)) {
            return false;
        }

        // Try to get language message
        $langMessage = language()->getLine($message, $context);

        // Re-Define message
        $message = empty($langMessage) ? $message : $langMessage;

        if ( ! is_dir($this->path)) {
            mkdir($this->path, true, 0775);
        }

        $this->lines[] = new \ArrayObject([
            'level'   => strtoupper($level),
            'time'    => date('r'),
            'message' => $message,
        ], \ArrayObject::ARRAY_AS_PROPS);

        $isNewFile = false;
        $filePath = $this->path . 'log-' . date('d-m-Y') . '.log';

        $log = '';

        if ( ! is_file($filePath)) {
            $isNewFile = true;
        }

        if ( ! $fp = @fopen($filePath, 'ab')) {
            return false;
        }

        $log .= strtoupper($level) . ' - ' . date('r') . ' --> ' . $message . "\n";

        flock($fp, LOCK_EX);

        $result = null;
        for ($written = 0, $length = strlen($log); $written < $length; $written += $result) {
            if (($result = fwrite($fp, substr($log, $written))) === false) {
                break;
            }
        }

        flock($fp, LOCK_UN);
        fclose($fp);

        if ($isNewFile === true) {
            chmod($filePath, 0664);
        }

        return (bool)is_int($result);
    }
301202
public function log($level, $message, array $context = array())
    {
        if (self::isSetLogger()) {
            return self::$logger->log($level, $message, $context);
        }

        return false;
    }
499681
public function log($level, $message, array $context = array())
    {
        $eol = isset($context['newLine']) && $context['newLine'] === false ? '' : PHP_EOL;
        
        if ($this->addLeveLMarkersToMessage && !empty($level)) {
            echo '<',$level,'>',$message,'</',$level,'>',$eol;
        } else {
            echo $message,$eol;
        }
    }
689858
public function log($level, $message, array $context = array())
    {
        if ($this->filtering && ! in_array($level, $this->enabled)) {
            return;
        }

        if ($this->apply_threshold) {
            return $this->writeThresholdedMessage($level, $message);
        }

        $this->writeMessage($level, $message);
    }
942834
public function log($level, $message, array $context = array())
    {
        if ($this->_logLevel >= self::LOG_LEVEL_DEBUG) {
            error_log($message . "\n", 3, $this->_logFile);
        }
    }
161868
public function log($level, $message, array $context = [])
    {
        if (in_array($level, $this->acceptedLevels, true)) {
            $this->logger->log($level, $message, $context);
        }
    }
904914
protected function logMessage($level, $message)
    {
        if (array_search($level, $this->levels) > $this->levelPosition) {
            return;
        }

        echo $message;
    }
89057
public static function handlePhpError($level, $message, $file, $line)
    {

        // don't want to print suppressed errors
        if (error_reporting() > 0) {
            if (self::$phpErrorCapture) {
                self::$capturedPhpErrors[] = [
                    'message' => $message,
                    'level' => $level,
                    'line' => $line,
                    'file' => $file
                ];
            } else {
                $message = '[PHP Error] ' . $message;
                $message .= ' [line ' . $line . ' of ' . $file . ']';

                switch ($level) {
                    case E_USER_DEPRECATED:
                    case E_DEPRECATED:
                    case E_STRICT:
                    case E_NOTICE:
                    case E_USER_NOTICE:
                        self::log($message, Project::MSG_VERBOSE);
                        break;
                    case E_WARNING:
                    case E_USER_WARNING:
                        self::log($message, Project::MSG_WARN);
                        break;
                    case E_ERROR:
                    case E_USER_ERROR:
                    default:
                        self::log($message, Project::MSG_ERR);
                } // switch
            } // if phpErrorCapture
        } // if not @
    }
1189578
public function error($message) {
        $message = printPretty($message, $return=true);

        $hStream = CLI ? \STDERR : fopen('php://stderr', 'a');
        fwrite($hStream, $message);
        if (!CLI) fclose($hStream);
    }
917510
public function err($message, $code = -1, $level = 'info')
    {
        return $this->ret->err($message, $code, $level);
    }
623040
public function log($level, $message, array $context = []) {
        if ($this->_emailsSent > $this->maxEmailsPerRun){
            return; // skip all checks if max number was already reached
        }
        if (in_array($level, $this->visibleLevels) && $this->emailAddress) {
            $mailer = $this->mailerClass;
            $mailer::get()->send($this->emailAddress, $this->getSubject($level, isset($context['fromClass']) ? $context['fromClass'] : ''), $this->getMessage($level, $message, $context));
            if ($this->_emailsSent++ > $this->maxEmailsPerRun){
                if ($this->dieWhenMaxEmailsIsReached) {
                    die(); // too many errors; 
                }
            }
        }
    }
353915
public static function log($level, $message)
    {
        if(self::$active)
        {
            self::getBackend()->addRecord($level, $message);
        }
    }
319819
private function keepMessage($level, $message) {
		if(static::LOG_LEVELS[$this->keepMessages] > static::LOG_LEVELS[$level]) {
			return;
		}

		if($level == '' || $level == 'LOG'){
			$keepMessage = $message;
		} else {
			$keepMessage = $level . " " . $message;
		}
		$this->logEntries[] = $keepMessage;
	}
353580
public function log($level, $message, array $context = array())
    {
        if (!array_key_exists($level, $this->levels)) {
            $level = $this->defaultLevel;
        }
        
        $level = \LoggerLevel::toLevel($this->levels[$level], $this->defaultLevel);
        
        $message = $this->formatter->format($level, $message, $context);

        $this->logger->log($level, $message);
    }
290409
public function log($level, $message, array $context = [])
    {
        $context['error_message'] = $message;
        $this->_lastMessage = JSON::stringify($context);

        if (!empty($this->_log) && \is_string($this->_log)) {
            \error_log($this->_lastMessage.PHP_EOL, 3, $this->_log);
        } else {
            \error_log($this->_lastMessage);
        }
    }
343982
protected function action($message, $level, $options = null) {
        $prefix = $this->get_prefix($level, $options);
        $depth = isset($options['depth']) ? $options['depth'] : 0;
        // Depending of the type (extension of the file), format differently
        if (substr($this->fullpath, -5) !== '.html') {
            $content = $prefix . str_repeat('  ', $depth) . $message . PHP_EOL;
        } else {
            $content = $prefix . str_repeat('&nbsp;&nbsp;', $depth) . htmlentities($message, ENT_QUOTES, 'UTF-8') . '<br/>' . PHP_EOL;
        }
        if (false === fwrite($this->fhandle, $content)) {
            throw new base_logger_exception('error_writing_file', $this->fullpath);
        }
        return true;
    }