From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2 2/3] log: add ability to match dynamic log based on shell pattern Date: Mon, 23 Apr 2018 16:59:08 -0700 Message-ID: <20180423165908.3b1a8db8@xeon-e3> References: <20180223205648.18690-1-stephen@networkplumber.org> <20180223211752.28651-3-stephen@networkplumber.org> <2341534.1pRvY70a1c@xps> <3970843.R7zKmtknVI@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Thomas Monjalon Return-path: Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id 74E9F187 for ; Tue, 24 Apr 2018 01:59:11 +0200 (CEST) Received: by mail-pf0-f170.google.com with SMTP id l27so10640477pfk.12 for ; Mon, 23 Apr 2018 16:59:11 -0700 (PDT) In-Reply-To: <3970843.R7zKmtknVI@xps> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, 23 Apr 2018 23:08:01 +0200 Thomas Monjalon wrote: > Hi Stephen, > > 04/04/2018 13:34, Thomas Monjalon: > > 23/02/2018 22:17, Stephen Hemminger: > > > Regular expressions are not the best way to match a hierarchical > > > pattern like dynamic log levels. And the separator for dynamic > > > log levels is period which is the regex wildcard character. > > > > > > A better solution is to use filename matching 'globbing' so > > > that log levels match like file paths. For compatibility, > > > use colon to separate pattern match style arguments. For > > > example: > > > --log-level 'pmd.net.virtio.*:debug' > > > > > > Signed-off-by: Stephen Hemminger > > > --- > > > +int > > > +rte_log_set_level_match(const char *pattern, uint32_t level) > > [...] > > > +/* set level by regular expression (using pattern match is preferred) */ > > > int > > > rte_log_set_level_regexp(const char *pattern, uint32_t level) > > > > I think "pattern" is more appropriate than "match" to differentiate > > from "regexp". So I suggest this function name: > > rte_log_set_level_pattern > > Are you OK to do a v3 with this change? > > Sure, I expected some feedback since it it was a semantic change in the API. Let me also recheck the documentation.