grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] dprintf implementation


From: Yoshinori K. Okuji
Subject: Re: [PATCH] dprintf implementation
Date: Thu, 24 Feb 2005 20:30:03 +0100
User-agent: KMail/1.7.1

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]