/** * Retrieve a logger named according to the value of the pClass.getName() * parameter. If the named logger already exists, then the existing instance * will be returned. Otherwise, a new instance is created. By default, loggers * do not have a set level but inherit it from their nearest ancestor with * a set level. * * @param pClass The class' logger to retrieve. * @return a logger named according to the value of the pClass.getName(). */ public static synchronized Logger getLogger(Class pClass) { initialize(); Logger logger= loggers.get(pClass); if(logger != null) { return logger; } int level= getLevel(pClass); logger= new Logger(pClass, level); loggers.put(pClass, logger); return logger; }
/** * Retrieve a logger named according to the value of the pClass.getName() parameter. If the named * logger already exists, then the existing instance will be returned. Otherwise, a new instance * is created. By default, loggers do not have a set level but inherit it from their nearest * ancestor with a set level. * * @param pClass The class' logger to retrieve. * @return a logger named according to the value of the pClass.getName(). */ public static synchronized Logger getLogger(Class pClass) { initialize(); Logger logger = loggers.get(pClass); if (logger != null) { return logger; } int level = getLevel(pClass); logger = new Logger(pClass, level); loggers.put(pClass, logger); return logger; }