[Gbootroot-devel] Verbosity Logging
Brought to you by:
freesource
From: Jonathan R. <mtt...@ac...> - 2000-08-22 20:08:25
|
On Sun, 20 Aug 2000, Cristian Ionescu-Idbohrn wrote: > Another thing I'm thinking of is a verbose option which would put more > progress info into the log file, tell the user where it's placed and leave > it there on exit. That would help both bug tracebility and also help > curious guys, like me, underdtand what's going out behind the scens. I am glad you brought this up. First I think we should consider using the sys function found in Yard: sub sys { open(SYS, "@_ 2>&1 |") or die "open on sys(@_) failed: $!"; while (<SYS>) { print LOGFILE; print if $CFG::verbosity > 0; } close(SYS) or die "Command failed: @_\nSee logfile for error message.\n"; 0; # like system() } package CFG; # $verbosity: 1 or 0 # # This controls only what is printed to the screen. # 0 --> only the important messages. # 1 --> all messages. # All messages will be written to the log file regardless of the setting. # $verbosity = 0; The error parts would be modified to feed the users chosen level of verbosity to a viewable widget. This would be a good way to handle system calls. We may also consider getting rid of as many sys() as possible and use Perl functions whenever we can. But one way or the other there should be a verbosity option which brings up a text widget to show things as they happen. And perhaps another option which allows the user to log stuff to a file, ofcourse things could be cut and pasted, too. Tell me what you think? |