Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Log and friends: specify logger name #667

Closed
lombokissues opened this issue Jul 14, 2015 · 11 comments
Closed

@Log and friends: specify logger name #667

lombokissues opened this issue Jul 14, 2015 · 11 comments

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 632)

@lombokissues
Copy link
Author

👤 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 ;-).

@lombokissues
Copy link
Author

👤 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.

@lombokissues
Copy link
Author

👤 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.

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Feb 04, 2014 at 20:56 UTC

  1. 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.

  2. In an upcoming version of lombok, it will be possible to configure the name of the 'log' field in a lombok.config file.

  3. @ 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 Log: Respect the java conventions #473.

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Feb 04, 2014 at 20:58 UTC

Wait, slava, please also read issue #540 :-)

@lombokissues
Copy link
Author

👤 slava.semushin   🕗 Feb 04, 2014 at 21:25 UTC

Wow! :) Issue #540 confirms that I really waiting it about 1 year :))

@lombokissues
Copy link
Author

👤 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.

@lombokissues
Copy link
Author

👤 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.

@lombokissues
Copy link
Author

👤 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.

@lombokissues lombokissues added the accepted The issue/enhancement is valid, sensible, and explained in sufficient detail label Jul 14, 2015
@lombokissues
Copy link
Author

👤 reinierz   🕗 Feb 11, 2014 at 03:28 UTC

Pull request has been integrated with some minor changes.

@lombokissues lombokissues removed the accepted The issue/enhancement is valid, sensible, and explained in sufficient detail label Jul 14, 2015
@lombokissues
Copy link
Author

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant