Re: [Gbootroot-devel] Verbosity Logging
Brought to you by:
freesource
From: Cristian Ionescu-I. <ci...@ax...> - 2000-08-24 15:51:32
|
First off: my toes are to big for this keyboard :-) What I thought was WARN showed up as WARM :-( On Thu, 24 Aug 2000, Jonathan Rosenbaum wrote: [snip] > I think it would be better to just log the FATAL error, then the user can > make corrections, and resubmit. FATAL errors are caused by things like > running out of disk space. I've been avoiding dies or croaks for most > cases deliberately, on the other hand, if the system doesn't have init, > the person is really in trouble. The majority of things which stop > execution can be corrected by the user without killing the program. > > > b. ERROR stops the execution cleans up and brings you back to some safe, > > previous stage; keeps as much as possible of the entered data and gives > > some indication on what the problem is > > This is already built into the program at least for the present > capabilities. > > > These two cover the verbosity level 0, above. > > Sounds right, basically in most cases this would be the error output from > system calls .. the 2> thing. > > > 3. WARM indicates that something didn't work out but the program can > > continue > > Distinguishing between WARM and FATAL will be difficult and impressive > thing to do. I leave this to you for figuring out. :) Let me explain what I thought of when I suggested WARN as a separate error level. We know what we're be going to do (at the beginning of the script). We have a plan. We also know we can't do things with our bare hands. We need some system tools. We know what system tools we need. Let's make sure we have access to those tools (sanity checks in an init phase right from the beginning, like: the program is there and is executable). Any problems that arise, report them as WARN (warnings) to the user. > > This would be verbositi level 1, above. > > > > 4. INFO would give something like a trace (debug level) > > I am kind of turning your approach of INFO inside out, but here is my > idea, though it isn't necessary right: > > FATAL is -v .. WARM & FATAL is -vv , INFO can be -vvv and -vvvv > > INFO can be STDOUT -> -vvv > INFO can be written description -> -vvvv Throughout the program I have > commented out written descriptions I used in BootRoot with #V# Sounds ok. > We may ditch a -v because WARM & FATAL may be difficult to establish. See above. > > Not everything executed is a shell command, so there's need for a function > > to do that too. > > > > Maybe '--verbosity <level>' may be a command line option? > > No, I've written too many command line programs. :) And there is really > no advantage doing this with gBootRoot because it is designed to be a > button pushing program. ok. > > Another way to specify it could be some button(s) on the main window? > > I think a spin button like what is being used for device size will be > used. This will have different levels of verbosity .. nothing .. 1 .. 4 > > I think setting up a collapsable/expandable advanced section may be kind > of cool, then verbosity, initrd setting and the like can be included > there. Alternatively, maybe a popup menu .. there many ways of doing > this. > > > The results can stay in a log file (like it's done now) or showed 'live' > > in another window. > > There will be a SAVE button on the visible log. I'll create some > functions to do this, and then you do the fine tuning. We will be > converting to sys(), too. > > What do you think? Go for it! Cheers, Cristian -- I respect faith, but doubt is what gets you an education. -- Wilson Mizner |