Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1D4PLl-0007MG-Gu for mharc-grub-devel@gnu.org; Thu, 24 Feb 2005 15:12:41 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D4PLj-0007Kh-Ba for grub-devel@gnu.org; Thu, 24 Feb 2005 15:12:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D4PLh-0007Jh-RI for grub-devel@gnu.org; Thu, 24 Feb 2005 15:12:38 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D4PJz-0005yC-9M for grub-devel@gnu.org; Thu, 24 Feb 2005 15:10:51 -0500 Received: from [212.43.237.68] (helo=kotoba.storever.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D4Of8-00049l-Tq for grub-devel@gnu.org; Thu, 24 Feb 2005 14:28:39 -0500 Received: from ASSP-nospam (localhost [127.0.0.1]) by kotoba.storever.com (Postfix) with ESMTP id A3D4CFEBD315 for ; Thu, 24 Feb 2005 20:28:36 +0100 (CET) Received: from 127.0.0.1 ([127.0.0.1] helo=localhost) by ASSP-nospam ; 24 Feb 05 19:28:36 -0000 From: "Yoshinori K. Okuji" Organization: enbug.org To: The development of GRUB 2 Date: Thu, 24 Feb 2005 20:30:03 +0100 User-Agent: KMail/1.7.1 References: <421A4CEA.5030603@yahoo.fr> <4ecefea8af9852b4ed0a0b046d73e9ee@penguinppc.org> <421D89FF.9010508@yahoo.fr> In-Reply-To: <421D89FF.9010508@yahoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200502242030.04298.okuji@enbug.org> Subject: Re: [PATCH] dprintf implementation X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Feb 2005 20:12:40 -0000 On Thursday 24 February 2005 09:02, Vincent Pelletier wrote: > Iirc there were differences of point of view on that matter. > Okuji, what do you think about that idea ? What I said was that you should use strings instead of bit fields. # This enables the debug mode for fs and disk. debug="fs disk" ...execute commands... # This disable the debug mode. debug="" Here you don't have to use bit fields (such as DEBUG_MODE_FS_BIT) at all. When dprintf is called, dprintf simply check if a specified category is included in the variable "debug". Like this: enabled = 0; if (grub_strstr (debug, "all")) enabled = 1; else if (grub_strstr (debug, category)) enabled = 1; Actually, strstr is not appropriate, because it does not consider word boundaries. Strings are much better because of the flexibility. Okuji