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 6C8ED200C85 for ; Tue, 30 May 2017 09:00:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 68F85160BC9; Tue, 30 May 2017 07:00:57 +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 AF272160BC1 for ; Tue, 30 May 2017 09:00:56 +0200 (CEST) Received: (qmail 24273 invoked by uid 500); 30 May 2017 07:00:55 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 24263 invoked by uid 99); 30 May 2017 07:00:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2017 07:00:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E659CC02C8 for ; Tue, 30 May 2017 07:00:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.379 X-Spam-Level: X-Spam-Status: No, score=0.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 3GaoGL2ABb9R for ; Tue, 30 May 2017 07:00:52 +0000 (UTC) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 5C4E75F21F for ; Tue, 30 May 2017 07:00:52 +0000 (UTC) Received: by mail-wm0-f48.google.com with SMTP id e127so85765771wmg.1 for ; Tue, 30 May 2017 00:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=ylJmqiTX5QIvFxxWFtBaKbkpG+rgZSqPQ/U/cmUqWLY=; b=osnvNOHhETAehGnuAXmNck3oRiEsKTNjdPBQrp1u8GGBhpi/CQABaWnNZVTfghEcm6 s9/LtcbkZz39H3Nr/7tZ9ov01CV6fEPZH3+d7WfAlGvDOdijUQ9PJg0zoVbm4OSGjXDZ i06al86Rj0bFNQXK8t1ywIRqKkQK7ZqLs1N6zsUIRYzPdJhTcDBadRY5/sBwDaFQOzZL +z9t/5KIznDrQdw78Y+xi++P9TbN1AQlOI+Ea6R1Fkn7vp/z8iYfQIvP8mXW1RZNl18o v67ccKoHZLSXVsuLL6E+VNAjzmkH5xJFTdmqw/lvBXOShZbzxwlT9vSpOgUdTEnIfz7D GUQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ylJmqiTX5QIvFxxWFtBaKbkpG+rgZSqPQ/U/cmUqWLY=; b=s2TYi9vNkJ0N09wRwF206DbtKQyrcGtJ37yiHmA6Uzr2BQdDvv8avoTCNoyzUrFY28 3dg8o0pQzrax9cwXNWOD+lBKBmnjo54Cl4Tys6SgZo1ppELFYPzd8I6Ej1m+bz0/yFow hMGmDS3Jp6/yiTeiLiuLZziz0DCuablsz7/7r6FCUXOIep4el7wn154CmAlg9QSAsCGM D+iCpA8xt7IfYP12dSp7sEwKtFqT4cWW8EISRVPJJ9XQbTnIvMgR5MovufdZgXk50Um+ HrTLBJclzl3FdT3v9ae+D7Q5DtsCF9z2/a808fzjh+KZlC+ZV/wpLiT5FRh3NkGrcXls whWA== X-Gm-Message-State: AODbwcCY9iG/tBSSCVKGY1F5QEXiGMRYU8iX4h0YEPkQ+EM4MG0qbhMH I9AVWPV8EIj39gm8 X-Received: by 10.80.164.175 with SMTP id w44mr15509231edb.19.1496127651898; Tue, 30 May 2017 00:00:51 -0700 (PDT) Received: from [10.129.15.32] (caron.approach.be. [188.118.19.81]) by smtp.gmail.com with ESMTPSA id f25sm6051136edf.36.2017.05.30.00.00.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 May 2017 00:00:50 -0700 (PDT) Reply-To: nickgearls@gmail.com Subject: Re: mod_substitute debugging To: dev@httpd.apache.org References: <0131ebc1-52a1-07cd-23bb-edc85e408adb@gmail.com> <88dd84fd-7e2d-6994-f11e-fddb4ca78fd0@apache.org> From: Nick Gearls Message-ID: <7b8542b8-a6bf-ab93-f045-81de66a56fa5@gmail.com> Date: Tue, 30 May 2017 09:00:49 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <88dd84fd-7e2d-6994-f11e-fddb4ca78fd0@apache.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB archived-at: Tue, 30 May 2017 07:00:57 -0000 Hi Ruediger, I understood that. My main question was "Which code do I include and release version and which one do I keep only for a debug build?" I have no problem to have everything included with a run-time check, I was just wondering if someone will not complain that this adds too much things. I'll prepare a patch to have everything included at run-time, we'll see the feedback. Thanks for your time On 24-05-2017 16:17, Ruediger Pluem wrote: > > On 05/24/2017 03:56 PM, Nick Gearls wrote: >> I added some debugging features in mod_substitute, damned useful when trying to troubleshoot things. >> I'll propose a patch but I'd like your advise about when to log debug info: >> >> I added the following info: >> 1. line to be parsed, type or search (regex/string), replace string >> 2. in case of matching, the new value >> >> All logging of debugging info is in level TRACE8 >> >> Remark: the matching string/regex is compiled, so it's not available at run-time. >> I added this info in the subst_pattern_t struct - with a #ifdef _DEBUG to not waste memory in release mode >> >> My main question is: do I leave all logging in release mode (TRACE8 level) or do I also make this logging dependent on >> the compile flag? > Neither :-). > > Have a look at the > > APLOG_*_IS_LEVEL macros in http_log.h and wrap the code that creates effort accordingly. > If the effort is just a simple ap_log_?error line then you need to nothing if compiled with a c99 compiler. See the > ap_log_* macro magic in http_log.h > > Regards > > RĂ¼diger >