[darcs-devel] Logging

Jason Dagit dagit at codersbase.com
Mon Sep 11 10:52:39 PDT 2006


On 9/11/06, David Roundy <droundy at darcs.net> wrote:
> On Sun, Sep 10, 2006 at 04:12:28PM -0700, Jason Dagit wrote:
> > Hello,
> >
> > I was working on the darcs source today and I realized that in a lot
> > of ways the current logging output is poor.  Mostly we don't have
> > enough of it.
> >
> > Here are some changes I started making:
> >
> > 1) In DarcsFlags change Verbose | Quiet to Verbose Int.  The
> > understanding would be that Verbose 0 == Quiet, Verbose 3 == standard
> > verbosity and Verbose 9 == Highest verbosity.  On the commandline
> > --verbose would be equivalent to -v3.
>
> I'd rather avoid putting an Int into verbose, as in my experience this
> makes it hard to keep consistent levels of verbosity than otherwise.
> I'd go with something more like
>
> data Verbosity = Quiet | Verbose | Debug

Reading through bits of the code I'd say we already have the
following, implicitly, defined:

data Verbosity = Quiet         -- only report errors
               | Standard      -- normal output level
               | Informational -- Not sure exactly how this is different
                               -- but it appears to be a step down from Verbose
                               -- but it may also have been meant to be
                               -- between Quiet and Standard
               | Verbose       -- As much output as possible

How about I merge Standard and Informational (unless someone knows
what the difference is?) and add Debug.  In case anyone wants to take
a look, I think I saw informational in Repository.lhs.  We can make
Verbosity derive (Eq, Ord) so that higher levels of verbosity imply
the lower levels (eg., Debug implies everything).

>
> and then we could add more levels when we add more constructors if we
> ever want more fine-grained logging.  But I imagine that just adding a
> --debug level will be sufficient for your goals.

Alright, I really prefer the -vn notation for specifying the verbosity
but I'll give --debug a try.

Thanks,
Jason




More information about the darcs-devel mailing list