protected void doLog()

in src/main/java/org/apache/sling/launchpad/base/app/MainDelegate.java [387:428]


        protected void doLog(Bundle bundle, @SuppressWarnings("rawtypes") ServiceReference sr, int level, String msg, Throwable throwable) {

            // unwind throwable if it is a BundleException
            if ((throwable instanceof BundleException) && (((BundleException) throwable).getNestedException() != null)) {
                throwable = ((BundleException) throwable).getNestedException();
            }

            final StringBuilder sb = new StringBuilder();
            if (sr != null) {
                sb.append("SvcRef ");
                sb.append(sr);
                sb.append(" ");
            } else if (bundle != null) {
                sb.append("Bundle '");
                sb.append(String.valueOf(bundle.getBundleId()));
                sb.append("' ");
            }
            sb.append(msg);
            if ( throwable != null ) {
                sb.append(" (");
                sb.append(throwable);
                sb.append(")");
            }
            final String s = sb.toString();

            switch (level) {
                case LOG_DEBUG:
                    debug("DEBUG: " + s);
                    break;
                case LOG_INFO:
                    info("INFO: " + s, throwable);
                    break;
                case LOG_WARNING:
                    warn("WARNING: " + s, throwable);
                    break;
                case LOG_ERROR:
                    error("ERROR: " + s, throwable);
                    break;
                default:
                    warn("UNKNOWN[" + level + "]: " + s, null);
            }
        }