[
https://issues.apache.org/jira/browse/SOLR-12690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16587980#comment-16587980
]
Erick Erickson commented on SOLR-12690:
---------------------------------------
Well, the code changes took very little time, running precommit and tests now.
Meanwhile, here are some exceptions in case someone is going to take a whack at
precommit failures, the simple grepping I did:
{{find . -name "*.java" | xargs fgrep "LoggerFactory.getLogger" | fgrep -v
"private static final Logger log ="}}
finds these false positives:
./solr/core/src/java/org/apache/solr/metrics/reporters/SolrSlf4jReporter.java:
builder = builder.outputTo(LoggerFactory.getLogger(logger));
./solr/core/src/java/org/apache/solr/servlet/CheckLoggingConfiguration.java:
LoggerFactory.getLogger(CheckLoggingConfiguration.class);
cd ./solr/core/src/java/org/apache/solr/core/SolrCore.java: private static
final Logger requestLog =
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass().getName() +
".Request");
./solr/core/src/java/org/apache/solr/core/SolrCore.java: private static final
Logger slowLog =
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass().getName() +
".SlowRequest");
// These two are inner classes where static is illegal.
./solr/core/src/java/org/apache/solr/util/StartupLoggingUtils.java: final
Logger rootLogger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
./solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java: private
final Logger log =
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
> Regularize LoggerFactory declarations
> -------------------------------------
>
> Key: SOLR-12690
> URL: https://issues.apache.org/jira/browse/SOLR-12690
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Reporter: Erick Erickson
> Assignee: Erick Erickson
> Priority: Minor
>
> LoggerFactory declarations have several different forms, they should all be:
> private static final Logger log =
> LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
> * lowercase log
> * private static
> * non hard-coded class lookup.
> I'm going to regularize all of these, I think there are about 80 currently,
> we've been nibbling away at this but I'll try to do it in one go.
> [~cpoerschke] I think there's another Jira about this that I can't find just
> now, ring any bells?
> Once that's done, is there a good way to make violations of this fail
> precommit?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]