IG: add log4j 2 logger default (IDEA-196735)

This commit is contained in:
Bas Leijdekkers
2019-01-23 11:19:07 +01:00
parent d189354504
commit df421b0b25
4 changed files with 12 additions and 10 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2012 Dave Griffith, Bas Leijdekkers
* Copyright 2003-2019 Dave Griffith, Bas Leijdekkers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,8 +15,6 @@
*/
package com.siyeh.ig.logging;
import com.intellij.codeInspection.ui.ListTable;
import com.intellij.codeInspection.ui.ListWrappingTableModel;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.psi.*;
@@ -42,16 +40,17 @@ public class ClassWithMultipleLoggersInspection extends BaseInspection {
public String loggerNamesString = "java.util.logging.Logger" + ',' +
"org.slf4j.Logger" + ',' +
"org.apache.commons.logging.Log" + ',' +
"org.apache.log4j.Logger";
"org.apache.log4j.Logger" + ',' +
"org.apache.logging.log4j.Logger";
public ClassWithMultipleLoggersInspection() {
parseString(this.loggerNamesString, this.loggerNames);
parseString(loggerNamesString, loggerNames);
}
@Override
public JComponent createOptionsPanel() {
final ListTable table = new ListTable(new ListWrappingTableModel(loggerNames, InspectionGadgetsBundle.message("logger.class.name")));
return UiUtils.createAddRemoveTreeClassChooserPanel(table, InspectionGadgetsBundle.message("choose.logger.class"));
return UiUtils.createTreeClassChooserList(loggerNames, InspectionGadgetsBundle.message("logger.class.name"),
InspectionGadgetsBundle.message("choose.logger.class"));
}
@Override
@@ -50,7 +50,8 @@ public class ClassWithoutLoggerInspection extends BaseInspection {
public String loggerNamesString = "java.util.logging.Logger" + ',' +
"org.slf4j.Logger" + ',' +
"org.apache.commons.logging.Log" + ',' +
"org.apache.log4j.Logger";
"org.apache.log4j.Logger" + ',' +
"org.apache.logging.log4j.Logger";
/**
* @noinspection PublicField
*/
@@ -38,7 +38,8 @@ public class NonStaticFinalLoggerInspection extends BaseInspection {
public String loggerClassName = "java.util.logging.Logger" + ',' +
"org.slf4j.Logger" + ',' +
"org.apache.commons.logging.Log" + ',' +
"org.apache.log4j.Logger";
"org.apache.log4j.Logger" + ',' +
"org.apache.logging.log4j.Logger";
public NonStaticFinalLoggerInspection() {
parseString(loggerClassName, loggerClassNames);
@@ -37,7 +37,8 @@ public class PublicMethodWithoutLoggingInspection extends BaseInspection {
public String loggerClassName = "java.util.logging.Logger" + ',' +
"org.slf4j.Logger" + ',' +
"org.apache.commons.logging.Log" + ',' +
"org.apache.log4j.Logger";
"org.apache.log4j.Logger" + ',' +
"org.apache.logging.log4j.Logger";
public PublicMethodWithoutLoggingInspection() {
parseString(loggerClassName, loggerClassNames);