setting exception state log
@param string $message error message
@param array $stackTrace statck trace
@param boolean $error if it's an error
186316
private function throwException($message,array $stackTrace , $error = true )
    {
        $this->exception($message,$stackTrace,$error);
    }
359439
function trace(message) {
    var logger = State.logger || console;
    if (!this.root().trace || !logger) { return; }
    logger.info(message);
  }
21947
public function failInitialization(string $message, ?\Throwable $error = null): void
    {
        // Log the exception in CloudWatch
        echo "$message\n";
        if ($error) {
            if ($error instanceof \Exception) {
                $errorMessage = get_class($error) . ': ' . $error->getMessage();
            } else {
                $errorMessage = $error->getMessage();
            }
            printf(
                "Fatal error: %s in %s:%d\nStack trace:\n%s",
                $errorMessage,
                $error->getFile(),
                $error->getLine(),
                $error->getTraceAsString()
            );
        }

        $url = "http://{$this->apiUrl}/2018-06-01/runtime/init/error";
        $this->postJson($url, [
            'errorMessage' => $message . ' ' . ($error ? $error->getMessage() : ''),
            'errorType' => $error ? get_class($error) : 'Internal',
            'stackTrace' => $error ? explode(PHP_EOL, $error->getTraceAsString()) : [],
        ]);

        exit(1);
    }
637889
public function error($msg, \Exception $e = null) {
		foreach($this->loggers as $logger)
			$logger->error($msg, $e);
	}
1322443
public function handleException($exception, array $error = null)
    {
        if (null === $error) {
            self::$exitCode = 255;
        }
        if (!$exception instanceof \Exception) {
            $exception = new FatalThrowableError($exception);
        }
        $type = $exception instanceof FatalErrorException ? $exception->getSeverity() : E_ERROR;
        $handlerException = null;

        if (($this->loggedErrors & $type) || $exception instanceof FatalThrowableError) {
            if (false !== strpos($message = $exception->getMessage(), "class@anonymous\0")) {
                $message = (new FlattenException())->setMessage($message)->getMessage();
            }
            if ($exception instanceof FatalErrorException) {
                if ($exception instanceof FatalThrowableError) {
                    $error = [
                        'type' => $type,
                        'message' => $message,
                        'file' => $exception->getFile(),
                        'line' => $exception->getLine(),
                    ];
                } else {
                    $message = 'Fatal '.$message;
                }
            } elseif ($exception instanceof \ErrorException) {
                $message = 'Uncaught '.$message;
            } else {
                $message = 'Uncaught Exception: '.$message;
            }
        }
        if ($this->loggedErrors & $type) {
            try {
                $this->loggers[$type][0]->log($this->loggers[$type][1], $message, ['exception' => $exception]);
            } catch (\Throwable $handlerException) {
            }
        }
        if ($exception instanceof FatalErrorException && !$exception instanceof OutOfMemoryException && $error) {
            foreach ($this->getFatalErrorHandlers() as $handler) {
                if ($e = $handler->handleError($error, $exception)) {
                    $exception = $e;
                    break;
                }
            }
        }
        $exceptionHandler = $this->exceptionHandler;
        $this->exceptionHandler = null;
        try {
            if (null !== $exceptionHandler) {
                return $exceptionHandler($exception);
            }
            $handlerException = $handlerException ?: $exception;
        } catch (\Throwable $handlerException) {
        }
        if ($exception === $handlerException) {
            self::$reservedMemory = null; // Disable the fatal error handler
            throw $exception; // Give back $exception to the native handler
        }
        $this->handleException($handlerException);
    }
740860
@Override
    public void error(String msg, Throwable error) {
        try {
            if ((verbose || stacktrace) && error != null) {
                printStackTrace(msg, error);
                error(ERROR, msg);
            } else {
                error(ERROR, msg + STACKTRACE_MESSAGE);
            }
        } finally {
            postPrintMessage();
        }
    }
78923
final protected static function callErrorLogger($level, $message)
	{
		if (is_null(static::$errorLoggerInstance)) {
			static::$errorLoggerInstance = new self;
		}
		static::$errorLoggerInstance->{
			static::$errorLoggerInstance->errorToLogLevel($level)
		}($message);
	}
14296
public function logFailure($message, \Exception $exception = null)
    {
        $context = array();

        // The psr3 log interface stipulates that exceptions should be passed
        // as the exception key in the context array.
        if ($exception) {
            $context['exception'] = $exception;
        }

        $this->log(
            "\033[0;31m" . $message . "\033[0m",
            LogLevel::ERROR,
            $context
        );
    }
17303
function (message) {
    var that = this;
    that._traceLogEventsCount();
    that.mc.trigger(TypeMsg$3.OnCreateError, message);
  }
959763
function handleError(state, message, ex) {
  logError(message + ' (In: ' + state.stack.join(' > ') + ')');
  if (ex) {
    logError(ex);
  }
}
909255
private function logException($message, $exception)
    {
        return $this->app['logger.system']->error(
            $message . ': ' . $exception->getMessage(),
            ['event' => 'exception', 'exception' => $exception]
        );
    }
1341616
private function filterStackTrace($stackTrace)
    {
        return array_values(
            array_filter($stackTrace, function ($st) {
                return !array_key_exists('class', $st) || substr($st['class'], 0, 16) != 'OpenCensus\Trace';
            })
        );
    }
1097865
private function formatStacktrace(array $stacktrace)
    {
        $this->root = $this->findApplicationRoot();

        $trace = '';
        if ($first = array_shift($stacktrace)) {
            $trace = $this->formatStacktraceEntry('ERR', $first);
        }

        if (!$this->logStacktraces) {
            return $trace;
        }

        foreach ($stacktrace as $index => $entry) {
            $trace .= $this->formatStacktraceEntry(sprintf('#%d', $index), $entry);
        }

        return $trace;
    }
575023
public function set_error($message, $halt = false)
    {
        if ($message instanceof Exception) {
            $message = $message->getMessage();
        }

        $this->_errors[] = $message;
        log_message('error', $message);

        if ($halt) {
            show_error($message);
        }
    }
645786
public void trace(Object message, Throwable exception) {
    log(Level.TRACE, message, exception);
  }
1128486
public static void printStackTrace(final String message, final Logger logger, final LogLevel logLevel) {
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        printStackTrace(message, Arrays.copyOfRange(stackTrace, 2, stackTrace.length), logger, logLevel);
    }
334636
protected function logException(\Exception $exception): void
    {
        if (!$this->logger) {
            return;
        }

        $message = sprintf(
            'Exception thrown when handling an exception (%s: %s at %s line %s)',
            get_class($exception),
            $exception->getMessage(),
            $exception->getFile(),
            $exception->getLine()
        );

        $this->logger->log($this->level, $message, [
            'exception' => $exception,
        ]);
    }