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

Re: dpkg-logger

On 2 Jan 1999, Martin Bialasinski wrote:

> >> "MS" == Martin Schulze <joey@finlandia.Infodrom.North.DE> writes:
> MS> I don't think that attemts re/directing output from certain
> MS> scripts to log files is the proper way.  Instead the correct
> MS> place to enable/disable/direct/redirect logging is dpkg.  Dpkg
> MS> should be aware of logging and input/output redirection.
> Hmm, this would make it even easier. No need to change the *inst
> files, dpkg could log its actions like "installing foo ... finished",
> "installing bar ... problem, leaving unconfigured" independent from
> the *inst scripts.
> Dpkg could redirect stdout/stderr to deb-log, and this program would
> handle the output the way the user wants it to do.
> Although we would only have two different message types: Infos
> (STDOUT) and Warnings (STDERR).

This is clearly IMHO the correct solution.

To implement the current suggestion (using an auxiliary dpkg-log program)
we would have to modify every script.  If we are going to modify every
script anyway, I suggest the following formula:

Scripts output informational messages on STDOUT.

Scripts output important messages on STDERR.

Scripts request interaction by outputting on FD 3.

Then the shell invoking them (i.e., dpkg, dselect or apt) does the
appropriate things.  For example, the shell redirects STDOUT to logger at
priority inof, redirects STDERR to logger at priority err, and when the
shell detects any output on FD 3 at all, it request user interaction (this
last action shold be hardly ever used).

If that's not enough granularity, then we can use more FDs.  But I am
convinced that it is much nicer to simply give the scripts a bunch of FDs
and use policy to mandate what kind of messages are sent on each, and
allow the user and his admintool to configure exactly where they all go,
than to build in complex pipes into every script.

This way, most maintainers can continue to simply use 'echo', and the
messages will go to an info log...


|  Jelibean aka  | jules@jellybean.co.uk         |  6 Evelyn Rd	       |
|  Jules aka     | jules@debian.org              |  Richmond, Surrey   |
|  Julian Bean   | jmlb2@hermes.cam.ac.uk        |  TW9 2TF *UK*       |
|  War doesn't demonstrate who's right... just who's left.             |
|  When privacy is outlawed... only the outlaws have privacy.          |

Reply to: