demizer / go-logs

A enhanced logging library for Go.
MIT License
3 stars 0 forks source link

Fix hierarchical output #9

Open demizer opened 9 years ago

demizer commented 9 years ago

Getting log output that looks like this:

[DBUG] [08] ...|next#277: mark: U+FFFD '�', start: 0, index: 6, line: 2
[INFO] [14] ...|emit#199: itemParagraph: "break." l.start: 0 (1) l.index: 6 (7) line: 2

[INFO] [03] ...|...|...|...|parse#346: Parser got token: &parse.item{ID:1, Type:4, Text:"A paragraph with a line", Line:1, StartPosition:1, Length:23}

[DBUG] [15] ...|...|...|...|...|paragraph#819: START
[DBUG] [13] lexParagraph#669: END
[DBUG] [06] lexStart#486: START
[DBUG] [06] lexStart#511: isEndOfLine == true
[DBUG] [06] lexStart#525: Found end of last line
[INFO] [14] ...|emit#199: itemEOF: "" l.start: 6 (7) l.index: 6 (7) line: 2
[DBUG] [06] lexStart#535: END
[DBUG] [05] run#183: End
[DBUG] [15] ...|...|...|...|...|paragraph#843: END
[DBUG] [04] ...|...|...|...|...|peek#424: Using &parse.item{ID:3, Type:0, Text:"", Line:2, StartPosition:7, Length:0}
[DBUG] [03] ...|...|...|...|parse#385: END
[DBUG] [01] ...|...|...|Parse#331: END

One possible way to fix this is to only increase by 1 level over the last output if the output jumps more than two levels.

Another way would be to experiment with a git log --graph type view...

demizer commented 9 years ago

Heirarchical output might will be removed as it dosen't really make a difference. It is also very broken.