Griffon
  1. Griffon
  2. GRIFFON-298

Add conditional logging on artifacts

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.2-beta-2
    • Fix Version/s: 0.9.2-beta-3
    • Component/s: cli
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Groovy 1.8 introduces a new annotation (@Log) which injects conditional logging to a class. Griffon artifacts already have a logging facility, however it would be great if the logging calls were conditional too, i.e the following code

      class SampleController {
          def action = {
              log.info "Hello from ${app.config.application.title}"
          }
      }
      

      would be automagically transformed (in bytecode) into

      class SampleController {
          def action = {
              if(log.infoEnabled) log.info "Hello from ${app.config.application.title}"
          }
      }
      

        Activity

        Hide
        Andres Almiray added a comment -

        Griffonc will inject conditional logging to all Griffon artifacts, scripts and addons. This feature can be disabled by specifying a command flag -Dgriffon.disable.logging.injeciton=true during compilation.

        Show
        Andres Almiray added a comment - Griffonc will inject conditional logging to all Griffon artifacts, scripts and addons. This feature can be disabled by specifying a command flag -Dgriffon.disable.logging.injeciton=true during compilation.

          People

          • Assignee:
            Andres Almiray
            Reporter:
            Andres Almiray
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: