Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user sruehl added a comment to the discussion: [Java] How should we handle "loggers"? a3ea768d2f7b35211d553505c9509b2c28a000d2 ([here](https://github.com/apache/plc4x/commit/a3ea768d2f7b35211d553505c9509b2c28a000d2#diff-29f99c8cd536dee245291d0c43c1db428fc4c628e4111670fb10d567c3ce18e1L188)) GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6227060 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user chrisdutz added a comment to the discussion: [Java] How should we handle "loggers"? Well you don't have to write boilerplate anyway as the IDE generates that for me So I do prefer that over having some tool generate stuff magically. GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6226499 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user glcj added a comment to the discussion: [Java] How should we handle "loggers"? Hello, I think we don't use loombok in the project (pom.xml). I think we should not add more libraries than necessary if it can be solved within the JDK tools. My grain of sand GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6221233 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user foxpluto added a comment to the discussion: [Java] How should we handle "loggers"? @chrisdutz It depends, if Lombok will be used for more feature than the simple logs one, enabling the plugin in the IDE will be worth. Lombok is a great tool for killing the Boiler Plate. GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6219960 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user sruehl added a comment to the discussion: [Java] How should we handle "loggers"? I think in most IDEs it is enabled by default nowadays GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6218907 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user chrisdutz added a comment to the discussion: [Java] How should we handle "loggers"? Well admittedly I would be hesitant to use lombok as it requires our users to setup additional plugins in their development environments. GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6218786 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user foxpluto added a comment to the discussion: [Java] How should we handle "loggers"? I would suggest for Java to use the notation `@Log4j2` present in Lombok to decrease the boilerplate an configure the logging notation externally as described here: [@Log (and friends)](https://projectlombok.org/features/log). I voted for "log" GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6217888 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user chrisdutz added a comment to the discussion: [Java] How should we handle "loggers"? Would be awesome, if we could see who voted how :-/ GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6170967 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
Hello, Totally agree on equalizing the use of logs (log, LOG, logger, LOGGER), and so on... If there is a best practice that does not imply adding more libraries to the existing ones, we should evaluate it. Kind regards, El sáb, 3 jun 2023 a las 17:18, Łukasz Dywicki () escribió: > The static logger declaration is still a thing made by (older/elder? ;)) > java developers, mainly because log4j 1.x/commons-logging/jul loggers > were advised to be made like that. With switch to slf4j static is no > longer mandatory/strongly recommended. > Most of code I make myself rely on logger field, but I've seen people > who do it with `@Slf4j` annotation coming from Lombok. > > Anyhow, is there a intention (not yet a plan) to unify this part of our > code? > > Best, > Łukasz > > On 2.06.2023 08:35, chrisdutz (via GitHub) wrote: > > > > GitHub user chrisdutz added a comment to the discussion: [Java] How > should we handle "loggers"? > > > > And here ... even the Slf4j folks no longer recommend any general way of > doing things: https://www.slf4j.org/faq.html#declared_static > > I guess in the past, there was a performance reason to to things, but > this no longer seems to apply today. > > > > GitHub link: > https://github.com/apache/plc4x/discussions/973#discussioncomment-6068178 > > > > > > This is an automatically sent email for dev@plc4x.apache.org. > > To unsubscribe, please send an email to: > dev-unsubscr...@plc4x.apache.org > > > -- *CEOS Automatización, C.A.* *GALPON SERVICIO INDUSTRIALES Y NAVALES FA, C.A.,* *PISO 1, OFICINA 2, AV. RAUL LEONI, SECTOR GUAMACHITO,* *FRENTE A LA ASOCIACION DE GANADEROS,BARCELONA,EDO. ANZOATEGUI* *Ing. César García* *Cel: +58 414-760.98.95* *Hotline Técnica SIEMENS: 0800 1005080* *Email: support.aan.automat...@siemens.com *
Re: [D] [Java] How should we handle "loggers"? (plc4x)
The static logger declaration is still a thing made by (older/elder? ;)) java developers, mainly because log4j 1.x/commons-logging/jul loggers were advised to be made like that. With switch to slf4j static is no longer mandatory/strongly recommended. Most of code I make myself rely on logger field, but I've seen people who do it with `@Slf4j` annotation coming from Lombok. Anyhow, is there a intention (not yet a plan) to unify this part of our code? Best, Łukasz On 2.06.2023 08:35, chrisdutz (via GitHub) wrote: GitHub user chrisdutz added a comment to the discussion: [Java] How should we handle "loggers"? And here ... even the Slf4j folks no longer recommend any general way of doing things: https://www.slf4j.org/faq.html#declared_static I guess in the past, there was a performance reason to to things, but this no longer seems to apply today. GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6068178 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user chrisdutz added a comment to the discussion: [Java] How should we handle "loggers"? Good point ... so there's a "almost not noticeable overhead" compared with a lot of new options, right? GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6069198 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user sruehl edited a comment on the discussion: [Java] How should we handle "loggers"? With the up-rise of structured loggers, context became more relevant. So with that in mind it is pretty helpful to have loggers enriched and pass it down to the downstream objects which enrich them by themselfs with their context variables. Recently in golang I moved to this pattern out of 3 reasons: 1. Have more control over the context 2. Easier way to configure them 3. Being able to assign those log statements to the relevant tests Point 3 becomes painfully important once you move into async territory So I would vote for having them instance bound. GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6068466 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user sruehl edited a comment on the discussion: [Java] How should we handle "loggers"? With the up-rise of structured loggers context became more relevant. So with that in mind it is pretty helpful to have loggers enriched and pass it down to the downstream objects which enrich them by themselfs with their context variables. Recently in golang I moved to this pattern out of 3 reasons: 1. Have more control over the context 2. Easier way to configure them 3. Being able to assign those log statements to the relevant tests Point 3 becomes painfully important once you move into async territory So I would vote for having them instance bound. GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6068466 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user sruehl added a comment to the discussion: [Java] How should we handle "loggers"? With the up-rise of static loggers context became more relevant. So with that in mind it is pretty helpful to have loggers enriched and pass it down to the downstream objects which enrich them by themselfs with their context variables. Recently in golang I moved to this pattern out of 3 reasons: 1. Have more control over the context 2. Easier way to configure them 3. Being able to assign those log statements to the relevant tests Point 3 becomes painfully important once you move into async territory So I would vote for having them instance bound. GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6068466 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org
Re: [D] [Java] How should we handle "loggers"? (plc4x)
GitHub user chrisdutz added a comment to the discussion: [Java] How should we handle "loggers"? And here ... even the Slf4j folks no longer recommend any general way of doing things: https://www.slf4j.org/faq.html#declared_static I guess in the past, there was a performance reason to to things, but this no longer seems to apply today. GitHub link: https://github.com/apache/plc4x/discussions/973#discussioncomment-6068178 This is an automatically sent email for dev@plc4x.apache.org. To unsubscribe, please send an email to: dev-unsubscr...@plc4x.apache.org