     "==== INTERESTING MESSAGES:" print nl
     "Total: " write dup values sum . nl
     [
-        dup second write ": " write third "\n" join write
+        dup level>> write ": " write message>> "\n" join write
     ] histogram.
     nl
     "==== WORDS:" print nl

: log-entry. ( entry -- )
    "====== " write
    {
        [ first (timestamp>string) bl ]
        [ second pprint bl ]
        [ third write nl ]
        [ fourth "\n" join print ]
    } cleave ;

: errors. ( errors -- )

SYMBOL: message-histogram

: analyze-entry ( entry -- )
    dup level>> { ERROR CRITICAL } memq? [ dup errors get push ] when
    1 over word-name>> word-histogram get at+
    dup word-name>> word-names get member? [
        1 over [ level>> ] [ word-name>> ] [ message>> ] tri 3array
        message-histogram get at+
    ] when
    drop ;

