A. Pagaltzis wrote:
> The most bangs I can count instantly by looking at them is four.
> For five bangs and up, all I see is “lots of bangs.” I have to
> count character by character to tell them apart. Visually,
> I can’t distinguish `fatal` from `fail` at all.  Another problem
> is that I’d never remember the exact hierarchy. So with your
> proposal I’d have to count bangs for any message of import, and
> then go look which number means what.

Do you, as a human, have to exactly distinguish them?  Isn't the content of
the message and the rough number of bangs enough?

    not ok 1
    !!!!! Failed test in foo.t line 2
    ok 2
    !!!!!!! WHOA!  The fabric of the universe just broke down!
    !!!!!!! This should never happen!  Please contact the author immediately!


Right now we have no means to distinguish and there's no problem when you're
eyeballing it.

    not ok 1
    # Failed test in foo.t line 2
    ok 2
    # WHOA THERE!  The fabric of the universe just broke down!
    # This should never happen!  Please contact the author immediately!

That said, I'm not happy with having so many bangs either.


> I would say that at least `pass`, `info` and `debug` should have
> different punctuation. So my minimal proposal is something like
> the following:
> 
>     fatal !!!!
> 
>     fail !!!
> 
>     warn !!
> 
>     notice !
> 
>     pass ?
> 
>     info @
> 
>     debug #
> 
> But I’d also say that these are not a strict hierarchy: you can
> sort it in several slightly different ways depending on what
> you’re looking out for. So it would be worthwhile to make the
> punctuation less regular and more self-explanatory.
> 
>     fatal X!!X
> 
>     fail !!
> 
>     warn !
> 
>     notice ?
> 
>     pass !?
> 
>     info @
> 
>     debug #

I'm wary of adding in too much punctuation.  Its really not clear what levels
!?, ?, X!!X and @ would mean, or even that they're log messages, without
looking it up.

And yes, the fixed set of bangs worries me.  There's no room to add a new
level in later.  I would like to use labels instead of numbers if possible.


> I’d also want an option to append something like ' [warn]' to
> warning messages, though.

This is something I'd leave up to your TAP harness to do.  Although there's
this possibility:

    1..1
    !info! Temp dir is "/tmp/aslkdjoiu3"
    not ok 1
    !fail! Failed test in foo.t line 3.
    !fail! got:      42
    !fail! expected: 23

Though I still think that's not as visually distinctive as:

    1..1
    ! Temp dir is "/tmp/aslkdjoiu3"
    not ok 1
    !!!!!! Failed test in foo.t line 3.
    !!!!!! got:      42
    !!!!!! expected: 23

Reply via email to