com.jfinal.log.Log Java Examples

The following examples show how to use com.jfinal.log.Log. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClassUtil.java    From jboot with Apache License 2.0 6 votes vote down vote up
/**
 * θŽ·ε–ε•δΎ‹
 *
 * @param clazz
 * @param <T>
 * @return
 */
public static <T> T singleton(Class<T> clazz) {
    Object object = singletons.get(clazz);
    if (object == null) {
        synchronized (clazz) {
            object = singletons.get(clazz);
            if (object == null) {
                object = newInstance(clazz);
                if (object != null) {
                    singletons.put(clazz, object);
                } else {
                    Log.getLog(clazz).error("cannot new newInstance!!!!");
                }

            }
        }
    }

    return (T) object;
}
 
Example #2
Source File: Slf4jLogFactory.java    From jboot with Apache License 2.0 5 votes vote down vote up
@Override
public Log getLog(Class<?> clazz) {
    if (useJdkLogger) {
        return new JdkLogger(clazz);
    }

    Logger log = LoggerFactory.getLogger(clazz);
    return log instanceof LocationAwareLogger ? new Slf4jLogger((LocationAwareLogger) log) : new Slf4jSimpleLogger(log);
}
 
Example #3
Source File: Slf4jLogFactory.java    From jboot with Apache License 2.0 5 votes vote down vote up
@Override
public Log getLog(String name) {
    if (useJdkLogger) {
        return new JdkLogger(name);
    }

    Logger log = LoggerFactory.getLogger(name);
    return log instanceof LocationAwareLogger ? new Slf4jLogger((LocationAwareLogger) log) : new Slf4jSimpleLogger(log);
}
 
Example #4
Source File: LogBackLogFactory.java    From my_curd with Apache License 2.0 4 votes vote down vote up
@Override
public Log getLog(Class<?> clazz) {
    return new LogBackLog(clazz);
}
 
Example #5
Source File: LogBackLogFactory.java    From my_curd with Apache License 2.0 4 votes vote down vote up
@Override
public Log getLog(String name) {
    return new LogBackLog(name);
}