Here you can find the source of error(Class> clz, String logStr, Throwable e)
Parameter | Description |
---|---|
clz | the class to be logged |
logStr | the message string to be logged |
e | the exception (throwable) to log |
public static void error(Class<?> clz, String logStr, Throwable e)
//package com.java2s; //License from project: Apache License import org.slf4j.LoggerFactory; public class Main { /**//from ww w .j a v a 2s . c o m * Log a message at the ERROR level. * * @param clz the class to be logged * @param logStr the message string to be logged */ public static void error(Class<?> clz, String logStr) { LoggerFactory.getLogger(clz).error("[" + clz.getSimpleName() + "] " + logStr); } /** * Log an exception (throwable) at the ERROR level with an * accompanying message. * * @param clz the class to be logged * @param logStr the message string to be logged * @param e the exception (throwable) to log */ public static void error(Class<?> clz, String logStr, Throwable e) { LoggerFactory.getLogger(clz).error("[" + clz.getSimpleName() + "] " + logStr, e); } }