Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3465E200B6C for ; Sun, 28 Aug 2016 14:36:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 32D1D160AB4; Sun, 28 Aug 2016 12:36:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 78331160AAF for ; Sun, 28 Aug 2016 14:36:21 +0200 (CEST) Received: (qmail 3434 invoked by uid 500); 28 Aug 2016 12:36:20 -0000 Mailing-List: contact notifications-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list notifications@groovy.apache.org Received: (qmail 3421 invoked by uid 99); 28 Aug 2016 12:36:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Aug 2016 12:36:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 892AF2C014E for ; Sun, 28 Aug 2016 12:36:20 +0000 (UTC) Date: Sun, 28 Aug 2016 12:36:20 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GROOVY-6932) @Log annotation does not check logging enablement inside closures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 28 Aug 2016 12:36:22 -0000 [ https://issues.apache.org/jira/browse/GROOVY-6932?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D154= 43380#comment-15443380 ]=20 ASF GitHub Bot commented on GROOVY-6932: ---------------------------------------- GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/401 GROOVY-6932: @Log annotation does not check logging enablement inside= =E2=80=A6 =E2=80=A6 closures You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy6932 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/401.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #401 =20 ---- commit 3a6c2b8586ea4c377581c8a531839ce081a67718 Author: paulk Date: 2016-08-28T12:33:49Z GROOVY-6932: @Log annotation does not check logging enablement inside c= losures ---- > @Log annotation does not check logging enablement inside closures > ----------------------------------------------------------------- > > Key: GROOVY-6932 > URL: https://issues.apache.org/jira/browse/GROOVY-6932 > Project: Groovy > Issue Type: Bug > Components: groovy-runtime > Affects Versions: 2.2.0, 2.3.3 > Environment: Windows 7, Groovy 2.3.3, JDK 1.8.0_05 > Reporter: Shorn > Priority: Minor > Attachments: LogAstProblem.groovy > > > Groovy doesn't do a check for whether the log level is enabled when the l= og statement is made from inside a closure. > I believe the attached script should not print "called with 3". > Result on my machine is: > Groovy version: 2.3.3 > Java version: 1.8.0_05-b13 > OS: Windows 7 > called with 1 > 12:03:30.119 [main] INFO TestCode - blah: 1 > called with 3 > Script: > {code} > @Grapes([ > @Grab(group=3D'org.slf4j', module=3D'slf4j-api', version=3D'1.7+'), > @Grab(group=3D'ch.qos.logback', module=3D'logback-classic', version=3D'= 1.+')]) > import groovy.util.logging.Slf4j > new TestCode().doSomethingThatLogs() > @Slf4j > class TestCode { > void doSomethingThatLogs(){ > println "Groovy version: ${GroovySystem.version}" > println "Java version: ${System.properties["java.runtime.version"]}" > println "OS: ${System.properties["os.name"]}" > println "" > log.info createLogString(1) > log.trace createLogString(2) > Closure c =3D { log.trace createLogString(3) } > c() > } > String createLogString(int p){ > println "called with $p" > return "blah: $p" > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)