Browse Source

Logging: Add method to create detached loggers, which use the darklaf Logger as their parent despite their package hierarchy.

pull/245/head
weisj 3 years ago
parent
commit
15d156f587
No known key found for this signature in database
GPG Key ID: 31124CB75461DA2A
  1. 2
      core/src/main/java/org/pbjar/jxlayer/plaf/ext/TransformUI.java
  2. 2
      core/src/main/java/org/pbjar/jxlayer/plaf/ext/transform/TransformRPMImpl.java
  3. 2
      core/src/main/java/org/pbjar/jxlayer/repaint/RepaintManagerUtils.java
  4. 2
      core/src/test/java/test/TooltipTest.java
  5. 2
      core/src/test/java/ui/tabbedPane/ClosableTabbedPaneDemo.java
  6. 6
      utils/src/main/java/com/github/weisj/darklaf/util/LogUtil.java

2
core/src/main/java/org/pbjar/jxlayer/plaf/ext/TransformUI.java

@ -118,7 +118,7 @@ public class TransformUI extends MouseEventUI<JComponent> {
private static final String KEY_VIEW = "view";
private static final boolean delegatePossible;
private static final RepaintManager wrappedManager = new TransformRepaintManager();
private static final Logger LOGGER = LogUtil.getLogger(TransformUI.class);
private static final Logger LOGGER = LogUtil.getDetachedLogger(TransformUI.class);
static {
boolean value;

2
core/src/main/java/org/pbjar/jxlayer/plaf/ext/transform/TransformRPMImpl.java

@ -52,7 +52,7 @@ import com.github.weisj.darklaf.util.LogUtil;
*/
public final class TransformRPMImpl {
private static final Logger LOGGER = LogUtil.getLogger(TransformRPMImpl.class);
private static final Logger LOGGER = LogUtil.getDetachedLogger(TransformRPMImpl.class);
/**
* A flag, indicating whether or not a very dirty initialization on created {@link RepaintManager}s must be
* performed.

2
core/src/main/java/org/pbjar/jxlayer/repaint/RepaintManagerUtils.java

@ -49,7 +49,7 @@ import com.github.weisj.darklaf.util.LogUtil;
*/
public final class RepaintManagerUtils {
private static final Logger LOGGER = LogUtil.getLogger(RepaintManagerUtils.class);
private static final Logger LOGGER = LogUtil.getDetachedLogger(RepaintManagerUtils.class);
/**
* Indicates the availability of SwingX on the class path.
*/

2
core/src/test/java/test/TooltipTest.java

@ -41,7 +41,7 @@ import com.github.weisj.darklaf.util.SystemInfo;
class TooltipTest extends AbstractImageTest {
private static final Logger LOGGER = LogUtil.getLogger(TooltipTest.class);
private static final Logger LOGGER = LogUtil.getDetachedLogger(TooltipTest.class);
public TooltipTest() {
super("tooltip");

2
core/src/test/java/ui/tabbedPane/ClosableTabbedPaneDemo.java

@ -32,7 +32,7 @@ import com.github.weisj.darklaf.util.LogUtil;
public class ClosableTabbedPaneDemo extends AbstractTabbedPaneDemo<ClosableTabbedPane> implements TabListener {
private static final Logger LOGGER = LogUtil.getLogger(ClosableTabbedPane.class);
private static final Logger LOGGER = LogUtil.getDetachedLogger(ClosableTabbedPane.class);
public static void main(final String[] args) {
ComponentDemo.showDemo(new ClosableTabbedPaneDemo());

6
utils/src/main/java/com/github/weisj/darklaf/util/LogUtil.java

@ -45,6 +45,12 @@ public final class LogUtil {
return logger;
}
public static Logger getDetachedLogger(final Class<?> clazz) {
Logger logger = getLogger(clazz);
logger.setParent(PARENT);
return logger;
}
public static void setLevel(final Level level) {
PARENT.setLevel(level);
LOG_HANDLER.setLevel(level);

Loading…
Cancel
Save