Working multi RCP platform
[lgpl/argeo-commons.git] / org.argeo.init / src / org / argeo / init / logging / ThinLogging.java
index d615678cd886e63c63b06f95080d3c3d53593f17..dd6fad2e3a5a54c261517b02f720cacf9f925278 100644 (file)
@@ -68,7 +68,7 @@ class ThinLogging implements Consumer<Map<String, Object>> {
        // we don't synchronize maps on purpose as it would be
        // too expensive during normal operation
        // updates to the config may be shortly inconsistent
-       private SortedMap<String, ThinLogger> loggers = new TreeMap<>();
+       private SortedMap<String, ThinLogger> loggers = Collections.synchronizedSortedMap(new TreeMap<>());
        private NavigableMap<String, Level> levels = new TreeMap<>();
        private volatile boolean updatingConfiguration = false;
 
@@ -191,6 +191,7 @@ class ThinLogging implements Consumer<Map<String, Object>> {
        }
 
        public Logger getLogger(String name, Module module) {
+               Objects.requireNonNull(name, "logger name");
                if (!loggers.containsKey(name)) {
                        ThinLogger logger = new ThinLogger(name, computeApplicableLevel(name));
                        loggers.put(name, logger);