Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-10716

Impossible to change logging Strategy in @Slf4j and other log annotations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.0.2, 4.0.3
    • None
    • ast builder
    • None
    • Patch

    Description

      I defined a groovy class with @Slf4j annotation with custom logging strategy, 
      like this:

      @Slf4j(loggingStrategy=MyStrategy)
      class Foo {
         public String getFoo() {
             log.error("Hi")
         }
      }
      

      But it remains use the original strategy.

      The problem is in the LogASTTransformation#createLoggingStrategy method where loggingStrategy is always obtained from the default value.

      Attachment contains source of fixed method.
      Please include the fix into the nearest release.

      Attachments

        1. createLoggingStrategy-snippet.java
          3 kB
          Alexander Kotikhov

        Activity

          People

            Unassigned Unassigned
            akotikhov Alexander Kotikhov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified