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

Comments

Projects
None yet
1 participant
@lombokissues
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 632)

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Collaborator

lombokissues commented Jul 14, 2015

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

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

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

Collaborator

lombokissues commented Jul 14, 2015

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

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

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

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

Collaborator

lombokissues commented Jul 14, 2015

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

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

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Pull request has been integrated with some minor changes.

Collaborator

lombokissues commented Jul 14, 2015

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

Pull request has been integrated with some minor changes.

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

End of migration

Collaborator

lombokissues commented Jul 14, 2015

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment