All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.smartboot.http.common.logging.LoggerFactory Maven / Gradle / Ivy

There is a newer version: 2.5.1
Show newest version
/*******************************************************************************
 * Copyright (c) 2017-2021, org.smartboot. All rights reserved.
 * project name: smart-http
 * file name: LoggerFactory.java
 * Date: 2021-01-27
 * Author: sandao ([email protected])
 ******************************************************************************/

package org.smartboot.http.common.logging;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 三刀([email protected])
 * @version V1.0 , 2021/1/27
 */
public final class LoggerFactory {
    private static final Map loggerMap = new HashMap<>();

    public static Logger getLogger(Class clazz) {
        return getLogger(clazz.getName());
    }

    public static Logger getLogger(String name) {
        Logger logger = loggerMap.get(name);
        if (logger != null) {
            return logger;
        }
        logger = new RunLogger(name);
        loggerMap.put(name, logger);
        return logger;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy