[slf4j-user] Automated checker for SLF4J

Kengo TODA skypencil at gmail.com
Sat Aug 11 11:33:15 CEST 2012


Thank you for your idea!

I have written tests and implementations. Try it if you have time.
You can use "Number of placeholder should be equal to number of
argument" rule in version 0.2-SNAPSHOT.

I'll release 0.2 stable at the next week. Thanks.



On Sat, Aug 11, 2012 at 12:34 AM, Roman Muntyanu
<rmuntyan at softserveinc.com> wrote:
> Nice idea.
> I wonder if it's possible to validate slf4j's formatting e.g.
>
>     catch(ItemNotFoundException ex) {
>       LOG.error("Item with id={} occurred and name={} does not exist", id, ex);
>     }
>
> would generate code-analysis warning that number of placeholders does not match the number of provided parameters
> and
>
>   LOG.debug("Hello {}!", new Object [] {"world", "people","moto"});
>
> would generate warning that there are more parameters than placeholders.
>
> -----Original Message-----
> From: slf4j-user-bounces at qos.ch [mailto:slf4j-user-bounces at qos.ch] On Behalf Of Kengo TODA
> Sent: Friday, August 10, 2012 14:31 PM
> To: slf4j-user at qos.ch
> Subject: Re: [slf4j-user] Automated checker for SLF4J
>
> Hello all SLF4J users.
>
> I have created a simple PMD ruleset for SLF4J. It helps to unify coding style and fix bug.
>
>     - https://github.com/eller86/ruleset-for-SLF4J
>
> I created it for myself, but I guess it would be helpful for some of you.
> I'm happy if it works well for you.
>
>
> Thanks.
>
>
> On Wed, Feb 1, 2012 at 11:50 PM, Kengo TODA <skypencil at gmail.com> wrote:
>> Hello.
>>
>> I'm finding automated checker for SLF4J like PMD ruleset or Findbugs plugin.
>> Because I want to pick up bad codes like:
>>   - giving wrong class to LoggerFactory#getLogger(Class) (maybe
>> copy-pasted from other class)
>>   - using static variable instead of instance variable to store Logger
>>   - calling LoggerFactory#getLogger in method
>>
>> I've googled but cannot find it.
>> Is there already developed one? Or, I have to develop it by own?
>>
>>
>> Thank you for your time.
>> Kengo TODA
>>
>> --
>> ***
>> Kengo TODA (eller86)
>> skypencil at gmail.com
>> http://skypencil.jp/
>
>
>
> --
> ***
> Kengo TODA (eller86)
> skypencil at gmail.com
> http://skypencil.jp/
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/slf4j-user
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/slf4j-user



-- 
***
Kengo TODA (eller86)
skypencil at gmail.com
http://skypencil.jp/


More information about the slf4j-user mailing list