Write out $msg to log file and to console as error message.

@param string $msg
558961
protected function logError(string $msg)
    {
        $this->logger->error('CMD: ' . $msg);
        $this->out->writeln("<error>$msg<error>");
    }
1019228
protected function log($level, $msg, $context = [])
    {
        $this->log[$level][] = $msg;
        \Log::log($level, $msg, $context);
    }
691988
protected function setError(string $msg)
    {
        $this->error = $msg;
        $lastError = error_get_last();
        if ($lastError !== null) {
            $this->errorDetail = sprintf(
                "'%s' in %s on line %s",
                $lastError['message'],
                $lastError['file'],
                $lastError['line']
            );
        }
    }
1189578
public function error($message) {
        $message = printPretty($message, $return=true);

        $hStream = CLI ? \STDERR : fopen('php://stderr', 'a');
        fwrite($hStream, $message);
        if (!CLI) fclose($hStream);
    }
52040
public function info($msg) {
		$this->mailMessage(self::LEVEL_INFO, $msg);

		if($this->checkLevel($this->loglevels, self::LEVEL_INFO) !== true)
			return;

		$this->writeMessage(self::LEVEL_INFO, $msg);
	}
160849
@Override
    public void error( F0<String> msg )
    {
        if ( compilerLogger.isErrorEnabled() )
        {
            String msgString = msg.apply();
            errors.append( msgString ).append( '\n' );
            compilerLogger.error( msgString );
        }
    }
255470
protected function error($message)
    {
        if ($this->output instanceof ConsoleOutputInterface) {
            $this->output->getErrorOutput()->writeln("<error>$message</error>");
        } else {
            $this->output->writeln("<error>$message</error>");
        }
    }
778983
public function consoleLog($msg, $level = 1)
    {
        $msg = str_replace("\r", '', $msg);
        $msg = explode("\n", $msg);
        foreach ($msg as $line) {
            if (strlen($line) < 1) {
                continue;
            }
            $this->send(
                'VERBOSE "' . str_replace('"', '\\"', $line) . '" ' . $level
            );
        }
    }
295286
public function error($msg, $data = NULL) {
        if (!$this->isAllowToLog(static::LOG_LEVEL_ERROR)) {
            return;
        }

        $this->log('error', $msg, $data);
    }
137178
private function addError(string $msg, ?string $field = null): void
    {
        if (!$field) {
            $field = 'all';
        }

        if (!($this->errors[$field] ?? [])) {
            $this->errors[$field] = [];
        }

        $this->errors[$field][] = $msg;
    }
1016128
protected function log($msg)
    {
        if (is_null($this->logger) === false) {
            $this->logger->log('Chatkit: '.$msg);
        }
    }
450843
protected function setError($msg) {
        $this->error_count++;
        if ($this->Mailer == 'smtp' and ! is_null($this->smtp)) {
            $lasterror = $this->smtp->getError();
            if (!empty($lasterror['error'])) {
                $msg .= $this->lang('smtp_error') . $lasterror['error'];
                if (!empty($lasterror['detail'])) {
                    $msg .= ' Detail: ' . $lasterror['detail'];
                }
                if (!empty($lasterror['smtp_code'])) {
                    $msg .= ' SMTP code: ' . $lasterror['smtp_code'];
                }
                if (!empty($lasterror['smtp_code_ex'])) {
                    $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];
                }
            }
        }
        $this->ErrorInfo = $msg;
    }
124628
private function log($msg)
    {
        $logger = $this->getConfig('logger');
        if (!$logger) return false;
        return call_user_func_array($logger, array($msg));
    }
1268845
def out(msg, error=False):
        "  "
        pipe = stdout
        if error:
            pipe = stderr
            msg = color_msg(msg, "warning")

        pipe.write("%s\n" % msg)
288905
public void error(final String msg)
    {
        errors++;

        if (!suppressOutput)
        {
            out.println("ERROR: " + msg);
        }

        if (stopOnError)
        {
            throw new IllegalArgumentException(msg);
        }
    }
918942
protected static function output_msg($msg) {
        global $CFG, $PAGE;

        // If we are using the web interface we want pretty messages.
        if (!CLI_SCRIPT) {

            $renderer = $PAGE->get_renderer('tool_behat');
            echo $renderer->render_error($msg);

            // Stopping execution.
            exit(1);

        } else {

            // We continue execution after this.
            $clibehaterrorstr = "Ensure you set \$CFG->behat_* vars in config.php " .
                "and you ran admin/tool/behat/cli/init.php.\n" .
                "More info in " . self::DOCS_URL;

            echo 'Error: ' . $msg . "\n\n" . $clibehaterrorstr;
        }
    }
736518
protected function _msg( $msg, $level = 0 )
	{
		$pre = '';
		for( $i = 0; $i < 2*$level; $i++ ) { $pre .= ' '; }

		echo str_pad( $pre . $msg, 70 );
	}