Examples of ThrowableProxy


Examples of ch.qos.logback.classic.spi.ThrowableProxy

    private class GradleAppender extends AppenderBase<ILoggingEvent> {
        @Override
        protected void append(ILoggingEvent event) {
            try {
                ThrowableProxy throwableProxy = (ThrowableProxy) event.getThrowableProxy();
                Throwable throwable = throwableProxy == null ? null : throwableProxy.getThrowable();
                String message = event.getFormattedMessage();
                LogLevel level = LogLevelConverter.toGradleLogLevel(event.getLevel(), event.getMarker());
                outputEventListener.onOutput(new LogEvent(event.getTimeStamp(), event.getLoggerName(), level, message, throwable));
            } catch (Throwable t) {
                // fall back to standard out
View Full Code Here

Examples of ch.qos.logback.classic.spi.ThrowableProxy

    public Throwable getThrowable() {
        if (th == null) {
            final IThrowableProxy throwableProxy = event.getThrowableProxy();
            if (throwableProxy != null) {
                if ((throwableProxy instanceof ThrowableProxy)) {
                    final ThrowableProxy throwableProxyImpl = (ThrowableProxy) throwableProxy;
                    th = throwableProxyImpl.getThrowable();
                }
            }
        }
        return th;
    }
View Full Code Here

Examples of org.apache.logging.log4j.core.impl.ThrowableProxy

    @Override
    public ThrowableProxy getThrownProxy() {
        // lazily instantiate the (expensive) ThrowableProxy
        if (thrownProxy == null) {
            if (thrown != null) {
                thrownProxy = new ThrowableProxy(thrown);
            }
        }
        return this.thrownProxy;
    }
View Full Code Here

Examples of org.apache.logging.log4j.core.impl.ThrowableProxy

        assertEquals(marker, other.getMarker());
        assertEquals(fqcn, other.getLoggerFqcn());
        assertEquals(level, other.getLevel());
        assertEquals(data, other.getMessage());
        assertNull("null after serialization", other.getThrown());
        assertEquals(new ThrowableProxy(t), other.getThrownProxy());
        assertEquals(map, other.getContextMap());
        assertEquals(contextStack, other.getContextStack());
        assertEquals(threadName, other.getThreadName());
        assertEquals(location, other.getSource());
        assertEquals(currentTimeMillis, other.getTimeMillis());
View Full Code Here

Examples of org.apache.logging.log4j.core.impl.ThrowableProxy

        if (throwable != null && options.anyLines()) {
            if (!(throwable instanceof ThrowableProxy)) {
                super.format(event, toAppendTo);
                return;
            }
            final ThrowableProxy t = (ThrowableProxy) throwable;
            final String trace = t.getExtendedStackTrace(options.getPackages());
            final int len = toAppendTo.length();
            if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
                toAppendTo.append(" ");
            }
            if (!options.allLines() || !Constants.LINE_SEP.equals(options.getSeparator())) {
View Full Code Here

Examples of org.apache.logging.log4j.core.impl.ThrowableProxy

        if (throwable != null && options.anyLines()) {
            if (!(throwable instanceof ThrowableProxy)) {
                super.format(event, toAppendTo);
                return;
            }
            final ThrowableProxy t = (ThrowableProxy) throwable;
            final String trace = t.getRootCauseStackTrace(options.getPackages());
            final int len = toAppendTo.length();
            if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
                toAppendTo.append(" ");
            }
            if (!options.allLines() || !Constants.LINE_SEP.equals(options.getSeparator())) {
View Full Code Here

Examples of org.apache.logging.log4j.core.impl.ThrowableProxy

    /**
     * {@inheritDoc}
     */
    @Override
    public void format(final LogEvent event, final StringBuilder toAppendTo) {
        ThrowableProxy proxy = null;
        if (event instanceof Log4jLogEvent) {
            proxy = ((Log4jLogEvent) event).getThrownProxy();
        }
        final Throwable throwable = event.getThrown();
        if (throwable != null && options.anyLines()) {
            if (proxy == null) {
                super.format(event, toAppendTo);
                return;
            }
            final String trace = proxy.getExtendedStackTraceAsString(options.getPackages());
            final int len = toAppendTo.length();
            if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
                toAppendTo.append(' ');
            }
            if (!options.allLines() || !Constants.LINE_SEPARATOR.equals(options.getSeparator())) {
View Full Code Here

Examples of org.apache.logging.log4j.core.impl.ThrowableProxy

    @Override
    public ThrowableProxy getThrownProxy() {
        // lazily instantiate the (expensive) ThrowableProxy
        if (thrownProxy == null) {
            if (thrown != null) {
                thrownProxy = new ThrowableProxy(thrown);
            }
        }
        return this.thrownProxy;
    }
View Full Code Here

Examples of org.apache.logging.log4j.core.impl.ThrowableProxy

    /**
     * {@inheritDoc}
     */
    @Override
    public void format(final LogEvent event, final StringBuilder toAppendTo) {
        ThrowableProxy proxy = null;
        if (event instanceof Log4jLogEvent) {
            proxy = ((Log4jLogEvent) event).getThrownProxy();
        }
        final Throwable throwable = event.getThrown();
        if (throwable != null && options.anyLines()) {
            if (proxy == null) {
                super.format(event, toAppendTo);
                return;
            }
            final String trace = proxy.getCauseStackTraceAsString(options.getPackages());
            final int len = toAppendTo.length();
            if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
                toAppendTo.append(' ');
            }
            if (!options.allLines() || !Constants.LINE_SEPARATOR.equals(options.getSeparator())) {
View Full Code Here

Examples of org.apache.logging.log4j.core.impl.ThrowableProxy

    /**
     * {@inheritDoc}
     */
    @Override
    public void format(final LogEvent event, final StringBuilder toAppendTo) {
        ThrowableProxy proxy = null;
        if (event instanceof Log4jLogEvent) {
            proxy = ((Log4jLogEvent) event).getThrownProxy();
        }
        final Throwable throwable = event.getThrown();
        if (throwable != null && options.anyLines()) {
            if (proxy == null) {
                super.format(event, toAppendTo);
                return;
            }
            final String trace = proxy.getExtendedStackTrace(options.getPackages());
            final int len = toAppendTo.length();
            if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
                toAppendTo.append(" ");
            }
            if (!options.allLines() || !Constants.LINE_SEP.equals(options.getSeparator())) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.