Java slf4j Logger getLog(Class clazz)

Here you can find the source of getLog(Class clazz)

Description

get Log

License

BSD License

Declaration

public static Logger getLog(Class clazz) 

Method Source Code


//package com.java2s;
/*L/*  w ww .  ja  v a2  s.c  o  m*/
 * Copyright Northwestern University.
 *
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.io/psc/LICENSE.txt for details.
 */

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main {
    public static Logger getLog(Class clazz) {
        return LoggerFactory.getLogger(getLogCategory(clazz));
    }

    /**
     * Provide a log category for the given class that is similar to that used by hibernate for
     * its own type classes.  This makes it easier to filter the log entries to show all type
     * bindings together.
     * @param clazz the type class
     * @return a log category starting with org.hibernate.type
     */
    public static String getLogCategory(Class clazz) {
        return new StringBuffer("org.hibernate.type.studycalendar.").append(clazz.getSimpleName()).toString();
    }
}

Related

  1. format(String messagePattern, Object... args)
  2. get(Class clazz)
  3. getClassLogger()
  4. getErrorMsg(String format, Object[] argArray)
  5. getIntValue(String strVal, int defVal)
  6. getLogger()
  7. getLogger()
  8. getLogger()
  9. getLogger(Class clazz)