private Bugsnag createBugsnag() {
        Bugsnag bugsnag = new Bugsnag(apiKey, false);
        bugsnag.setAutoCaptureSessions(false);

        if (appType != null) {
            bugsnag.setAppType(appType);
        }

        if (appVersion != null) {
            bugsnag.setAppVersion(appVersion);
        }

        if (endpoint != null) {
            bugsnag.setEndpoints(endpoint, null);
        }

        if (proxy != null) {
            bugsnag.setProxy(
                    new Proxy(
                            proxy.getType(),
                            new InetSocketAddress(proxy.getHostname(), proxy.getPort())));
        }

        if (releaseStage != null) {
            bugsnag.setReleaseStage(releaseStage);
        }

        if (timeout > 0) {
            bugsnag.setTimeout(timeout);
        }

        if (filteredProperties.size() > 0) {
            bugsnag.setFilters(filteredProperties.toArray(new String[0]));
        }

        bugsnag.setIgnoreClasses(ignoredClasses.toArray(new String[0]));

        if (notifyReleaseStages.size() > 0) {
            bugsnag.setNotifyReleaseStages(notifyReleaseStages.toArray(new String[0]));
        }

        bugsnag.setProjectPackages(projectPackages.toArray(new String[0]));
        bugsnag.setSendThreads(sendThreads);

        // Add a callback to put global meta data on every report
        bugsnag.addCallback(new Callback() {
            @Override
            public void beforeNotify(Report report) {

                for (LogbackMetaData metaData : globalMetaData) {
                    for (LogbackMetaDataTab tab : metaData.getTabs()) {
                        for (LogbackMetaDataKey key : tab.getKeys()) {
                            report.addToTab(tab.getName(),
                                    key.getName(),
                                    key.getValue());
                        }
                    }

                }
            }
        });

        return bugsnag;
    }
private Bugsnag createBugsnag ( ) { Bugsnag bugsnag = new Bugsnag ( apiKey , false ) ; bugsnag . setAutoCaptureSessions ( false ) ; if ( appType != null ) { bugsnag . setAppType ( appType ) ; } if ( appVersion != null ) { bugsnag . setAppVersion ( appVersion ) ; } if ( endpoint != null ) { bugsnag . setEndpoints ( endpoint , null ) ; } if ( proxy != null ) { bugsnag . setProxy ( new Proxy ( proxy . getType ( ) , new InetSocketAddress ( proxy . getHostname ( ) , proxy . getPort ( ) ) ) ) ; } if ( releaseStage != null ) { bugsnag . setReleaseStage ( releaseStage ) ; } if ( timeout > 0 ) { bugsnag . setTimeout ( timeout ) ; } if ( filteredProperties . size ( ) > 0 ) { bugsnag . setFilters ( filteredProperties . toArray ( new String [ 0 ] ) ) ; } bugsnag . setIgnoreClasses ( ignoredClasses . toArray ( new String [ 0 ] ) ) ; if ( notifyReleaseStages . size ( ) > 0 ) { bugsnag . setNotifyReleaseStages ( notifyReleaseStages . toArray ( new String [ 0 ] ) ) ; } bugsnag . setProjectPackages ( projectPackages . toArray ( new String [ 0 ] ) ) ; bugsnag . setSendThreads ( sendThreads ) ; bugsnag . addCallback ( new Callback ( ) { @ Override public void beforeNotify ( Report report ) { for ( LogbackMetaData metaData : globalMetaData ) { for ( LogbackMetaDataTab tab : metaData . getTabs ( ) ) { for ( LogbackMetaDataKey key : tab . getKeys ( ) ) { report . addToTab ( tab . getName ( ) , key . getName ( ) , key . getValue ( ) ) ; } } } } } ) ; return bugsnag ; }
@return Create a Bugsnag instance with parameters from the logback configuration