You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2015/12/01 08:55:10 UTC

[jira] [Comment Edited] (SOLR-8330) Restrict logger visibility throughout the codebase to private so that only the file that declares it can use it

    [ https://issues.apache.org/jira/browse/SOLR-8330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15033273#comment-15033273 ] 

Uwe Schindler edited comment on SOLR-8330 at 12/1/15 7:54 AM:
--------------------------------------------------------------

This is the correct fix. Class#toString() (which is used implicit by the string concat here), returns "class oas.SolrCore" including "class " prefix. This is a common programming error.

By the way, this declaration passes the checker, because there is already *another* valid logger declaration there. This may also be a workarund for other places: Just declare a *correct* logger in the same file and you are able to do other, incorrect logger declarations :-)


was (Author: thetaphi):
This is the correct fix. Class#toString() (which is used implicit by the string concat here), returns "class oas.SolrCore" including "class " prefix. This is a common programming error.

> Restrict logger visibility throughout the codebase to private so that only the file that declares it can use it
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-8330
>                 URL: https://issues.apache.org/jira/browse/SOLR-8330
>             Project: Solr
>          Issue Type: Sub-task
>    Affects Versions: Trunk
>            Reporter: Jason Gerlowski
>            Assignee: Anshum Gupta
>              Labels: logging
>             Fix For: Trunk
>
>         Attachments: SOLR-8330-combined.patch, SOLR-8330-detector.patch, SOLR-8330-detector.patch, SOLR-8330.patch, SOLR-8330.patch, SOLR-8330.patch, SOLR-8330.patch, SOLR-8330.patch
>
>
> As Mike Drob pointed out in Solr-8324, many loggers in Solr are unintentionally shared between classes.  Many instances of this are caused by overzealous copy-paste.  This can make debugging tougher, as messages appear to come from an incorrect location.
> As discussed in the comments on SOLR-8324, there also might be legitimate reasons for sharing loggers between classes.  Where any ambiguity exists, these instances shouldn't be touched.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org