18 package com.mysql.clusterj.core.util;
20 import java.util.HashMap;
22 import java.util.logging.LogManager;
39 static final LogManager logManager = LogManager.getLogManager();
42 static final Map<String, Logger> loggerMap =
new HashMap<String, Logger>();
55 java.util.logging.Logger logger = java.util.logging.Logger.getLogger(loggerName);
57 loggerMap.put(loggerName, result);
61 @SuppressWarnings(
"unchecked")
62 public
Logger getInstance(Class cls) {
63 String loggerName = getPackageName(cls);
64 return getInstance(loggerName);
68 Logger result = loggerMap.get(loggerName);
81 final private static String getPackageName(Class<?> cls)
83 String className = cls.getName();
84 int index = className.lastIndexOf(
'.');
85 return ((index != -1) ? className.substring(0, index) :
"");