Java slf4j Logger caught(Exception e, String... bizDesc)

Here you can find the source of caught(Exception e, String... bizDesc)

Description

caught

License

Open Source License

Declaration

public static void caught(Exception e, String... bizDesc) 

Method Source Code


//package com.java2s;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main {
    private static final Logger LOGGER = LoggerFactory.getLogger("COMMON-ERROR");
    private static final String SEPERATOR = "|";
    private static final String EMPTY_STRING = "";

    public static void caught(Exception e, String... bizDesc) {
        if (null == e) {//e instanceof AmsNullClientInfoException ||
            return;
        }/* ww  w .  j a v a  2s .  c om*/

        LOGGER.error(buildDesc(bizDesc), e);
    }

    private static String buildDesc(String... bizDesc) {
        if (null == bizDesc) {
            return EMPTY_STRING;
        }

        StringBuilder sb = new StringBuilder();
        for (String desc : bizDesc) {
            if (sb.length() > 0) {
                sb.append(SEPERATOR);
            }
            sb.append(desc);
        }

        return sb.toString();
    }
}

Related

  1. alarm(String string)
  2. callShell(final String shellString, final Logger log)
  3. checkInterrupted(String type, String name, Logger logger)
  4. cleanLoggingMdc()
  5. clearRequestId()
  6. close(final AutoCloseable closeable, final Logger log)