mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IG: add log4j 2 logger default (IDEA-196735)
This commit is contained in:
+6
-7
@@ -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
|
||||
|
||||
+2
-1
@@ -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
|
||||
*/
|
||||
|
||||
+2
-1
@@ -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);
|
||||
|
||||
+2
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user