Migrated from Google Code (issue 632)
👤 m.th.mulders 🕗 Jan 30, 2014 at 09:35 UTC
Currently, @ Log and friends create a Logger object whose name is exactly the name of the class that has the @ Log annotations.
Sometimes however you might want to use a different name for the logger. It would be nice if that could be specified using @ Log(name="foo"), for example. If the name is not specified, current behaviour would be just fine.
Obviously, the naming is open for discussion ;-).
👤 m.th.mulders 🕗 Jan 30, 2014 at 10:35 UTC
By the way, I wouldn't mind giving this a shot and - given that everything works - creating a pull request.
👤 slava.semushin 🕗 Feb 04, 2014 at 19:50 UTC
I also waiting for this feature, because for all static members I use names in upper case and "log" violates this rule.
👤 r.spilker 🕗 Feb 04, 2014 at 20:56 UTC
The last comment is a demonstration of the fact that we need a better name for this feature. 'topic' or 'channel' comes to mind. @ slava, this issue is not about the field name.
In an upcoming version of lombok, it will be possible to configure the name of the 'log' field in a lombok.config file.
@ slava: you are probably under the false impression that the convention dictates that static final fields should be uppercase. The actual convention mentions constants, not static finals. Loggers have observable mutable state and are therefore not constants. See issue #473.
👤 r.spilker 🕗 Feb 04, 2014 at 20:58 UTC
Wait, slava, please also read issue #540 :-)
👤 slava.semushin 🕗 Feb 04, 2014 at 21:25 UTC
Wow! :) Issue #540 confirms that I really waiting it about 1 year :))
👤 r.spilker 🕗 Feb 04, 2014 at 21:35 UTC
@ m.th.mulders: help is appreciated. The work is not necessarily in the implementation, but also in the tests, documentation and finding the right name for the property.
If you want to take this one, please go ahead. Don't forget to add your name to the AUTHORS file. If you need any help, you can mail me directly at my personal address, roel, in the projectlombok.org domain.
👤 m.th.mulders 🕗 Feb 08, 2014 at 20:16 UTC
I've created a pull request where I used the name 'category' for the feature itself, and chose to use the 'value' property in the various annotations. The pull request contains implementation, tests and documentation.
The changes have been tested with OpenJDK 6, OpenJDK 7, Oracle JDK 7. I've skipped Oracle JDK 8 since master isn't working with that neither.
👤 r.spilker 🕗 Feb 10, 2014 at 19:50 UTC
We're reviewing the code right now. At a glance the code looks fine, but we'll do some modifications.
Based on the feedback on the forum, we're not going to use the 'value' for this, since it is easily confused with the name of the field. One suggestion was to use 'topic' instead. We'll probably run with that.
👤 reinierz 🕗 Feb 11, 2014 at 03:28 UTC
Pull request has been integrated with some minor changes.
End of migration