di
di copied to clipboard
df1: Write formal spec
As of df1 0.2
there is a draft BNF specification in the docs. This hasn't been verified, however.
I am curious why Level comes after Path? Certainly not easier for humans to read I think.
Anyway just a random thought/question - I haven't even tried the libraries :-)
Hello @juhp! How are you? Good question. There are two reasons for this.
- The level words (DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY) are not of the same length. This means that when rendered as a prefix, they will cause the following
/foo bar=baz /qux
path to be misaligned vertically across multiple lines. I find this to be more harmful to quick visual pattern recognition than putting the level later. Consider how this example would change if the paths were misaligned vertically:
- The level words are not a well-formed path part (those need to start with
/
or have a=
in it), so if we put it right after the path, it can serve as a separator between the path and the message, too. Otherwise, we'd need some kind of separator to tell the path apart from the message.
I'm happy to entertain different ideas if you have them. I haven't been able to come up with a better solution than the current one. Colors help a lot.