Java slf4j Logger error(String msg, Throwable e)

Here you can find the source of error(String msg, Throwable e)

Description

error

License

Open Source License

Declaration

public static void error(String msg, Throwable e) 

Method Source Code


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

public class Main {
    private static Logger logger = null;

    public static void error(String msg) {
        StackTraceElement se = Thread.currentThread().getStackTrace()[2];
        String clazzMethod = " " + se.getClassName() + "." + se.getMethodName() + "(" + se.getFileName() + ":"
                + se.getLineNumber() + ") ";

        String log = clazzMethod + "   " + " MSG: " + msg;
        logger.error(log);/*  www.j  av a 2s.  co  m*/
    }

    public static void error(String msg, Throwable e) {
        StackTraceElement se = Thread.currentThread().getStackTrace()[2];
        String clazzMethod = " " + se.getClassName() + "." + se.getMethodName() + "(" + se.getFileName() + ":"
                + se.getLineNumber() + ") ";

        String log = clazzMethod + "   " + " MSG: " + msg;
        logger.error(log, e);
    }
}

Related

  1. error(Class clz, String logStr, Throwable e)
  2. error(final BundleContext b, final String msg, final Throwable t)
  3. error(Logger log, String fmt, String... args)
  4. error(Logger logger, Exception e)
  5. error(String errorMessage, Throwable e)
  6. ExecptionLog(Logger log, String msg, Throwable e)
  7. extractValue(String var)
  8. findMarker(Marker marker, String name)
  9. format(final String pattern, final @Nullable Object... arguments)