|
From: | Serbinenko Vladimir |
Subject: | Re: debug prints |
Date: | Sun, 23 Jan 2005 19:21:19 +0100 |
User-agent: | Mozilla Thunderbird 1.0 (X11/20041206) |
Hollis Blanchard wrote:
What would you guys think of something like this: int grub_debug; int grub_debug_printf (const char *fmt, ...) { va_list ap; int ret; if (! grub_debug) return; va_start (ap, fmt); ret = grub_vprintf (fmt, ap); va_end (ap); return ret; }Then grub_debug can be set at runtime to enable debugging messages, which could be quite helpful. If we wanted to get fancy, we could turn grub_debug into a set of flags (e.g. FILESYSTEM, PARTITION, DISK, LINUX, MEMORY) to selectively debug specific systems.
I would suggest that you use environment variable like if(!grub_env_get("debug") || grub_strcmp(grub_env_get("debug"),"1")) return;
[Prev in Thread] | Current Thread | [Next in Thread] |