diff options
author | Anjum Fatima | 2017-05-19 15:15:16 +0000 |
---|---|---|
committer | Thomas Watson | 2017-06-16 12:38:08 +0000 |
commit | c2b47540bcf763ccaca1665d0857df532f5eb49b (patch) | |
tree | 0c77fb3df07ba5f87b07c49174eee1fa2450e18d | |
parent | c7b761a4613fb44c460b6479a2b6508f99a943f4 (diff) | |
download | rt.equinox.framework-c2b47540bcf763ccaca1665d0857df532f5eb49b.tar.gz rt.equinox.framework-c2b47540bcf763ccaca1665d0857df532f5eb49b.tar.xz rt.equinox.framework-c2b47540bcf763ccaca1665d0857df532f5eb49b.zip |
Revert "Bug 515869 - [osgi R7] Clarification on what a null value means
for"
This reverts commit 791edd6dda59767c891181046c119654db57a9f8.
Change-Id: I14bda5938ab465760e91ff52ff05596c297d81a6
Signed-off-by: Anjum Fatima <anjum.eclipse@gmail.com>
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java | 74 |
1 files changed, 19 insertions, 55 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java index e6719a109..a33f86c38 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2017 Cognos Incorporated, IBM Corporation and others + * Copyright (c) 2006, 2016 Cognos Incorporated, IBM Corporation and others * All rights reserved. This program and the accompanying materials are made * available under the terms of the Eclipse Public License v1.0 which * accompanies this distribution, and is available at @@ -129,36 +129,29 @@ public class ExtendedLogServiceFactory implements ServiceFactory<ExtendedLogServ contextsLock.readLock().lock(); try { LogLevel level = null; - String loggerName = name; - loggerName = isLoggerNamePresent(loggerName); - - if (loggerName != null) { - level = contextLogLevels.get(loggerName); - if (level == null && contextName != null) { - // non-null context name is a non-root context; - // must check the root context for non-root contexts - EquinoxLoggerContext rootContext = loggerContextTargetMap.getRootLoggerContext(); - if (rootContext != null) { - level = rootContext.getEffectiveLogLevel(loggerName); - } + String lookupName = name; + while ((level = contextLogLevels.get(lookupName)) == null) { + int lastDot = lookupName.lastIndexOf('.'); + if (lastDot >= 0) { + lookupName = lookupName.substring(0, lastDot); + } else { + break; } - } - - else { - if (contextName != null) { - EquinoxLoggerContext rootContext = loggerContextTargetMap.getRootLoggerContext(); - if (rootContext != null) { - level = rootContext.getEffectiveLogLevel(name); - } - + if (level == null) { + level = contextLogLevels.get(Logger.ROOT_LOGGER_NAME); + } + if (level == null && contextName != null) { + // non-null context name is a non-root context; + // must check the root context for non-root contexts + EquinoxLoggerContext rootContext = loggerContextTargetMap.getRootLoggerContext(); + if (rootContext != null) { + level = rootContext.getEffectiveLogLevel(name); } } - if (level == null) { level = LogLevel.WARN; } - return level; } finally { contextsLock.readLock().unlock(); @@ -211,35 +204,6 @@ public class ExtendedLogServiceFactory implements ServiceFactory<ExtendedLogServ contextsLock.readLock().unlock(); } } - - /* - * Purpose : To check whether lookupName is present in the contextLogLevels map or not - * and return the lookupName accordingly. - * - */ - public String isLoggerNamePresent(String lookupName) { - - String loggerName = lookupName; - while (!contextLogLevels.containsKey(loggerName)) { - int lastDot = loggerName.lastIndexOf('.'); - if (lastDot >= 0) { - loggerName = loggerName.substring(0, lastDot); - } else { - break; - } - } - - if (!contextLogLevels.containsKey(loggerName)) { - - if (contextLogLevels.containsKey(Logger.ROOT_LOGGER_NAME)) { - loggerName = Logger.ROOT_LOGGER_NAME; - } else { - loggerName = null; - } - } - - return loggerName; - } - } -}
\ No newline at end of file + +} |