Fixing logging

db4
Slava Pestov 2008-03-07 17:20:15 -06:00
parent c6c7269d45
commit 71a1edf426
2 changed files with 14 additions and 13 deletions

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel sequences namespaces words assocs logging sorting
prettyprint io io.styles strings logging.parser ;
prettyprint io io.styles strings logging.parser calendar.format ;
IN: logging.analysis
SYMBOL: word-names
@ -42,16 +42,14 @@ SYMBOL: message-histogram
] tabular-output ;
: log-entry.
[
dup first [ write ] with-cell
dup second [ pprint ] with-cell
dup third [ write ] with-cell
fourth "\n" join [ write ] with-cell
] with-row ;
"====== " write
dup first (timestamp>string) bl
dup second pprint bl
dup third write nl
fourth "\n" join print ;
: errors. ( errors -- )
standard-table-style
[ [ log-entry. ] each ] tabular-output ;
[ log-entry. ] each ;
: analysis. ( errors word-histogram message-histogram -- )
"==== INTERESTING MESSAGES:" print nl

View File

@ -1,8 +1,9 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: logging.analysis logging.server logging smtp io.sockets
kernel io.files io.streams.string namespaces alarms assocs
io.encodings.utf8 accessors calendar ;
USING: logging.analysis logging.server logging smtp kernel
io.files io.streams.string namespaces alarms assocs
io.encodings.utf8 accessors calendar qualified ;
QUALIFIED: io.sockets
IN: logging.insomniac
SYMBOL: insomniac-smtp-host
@ -25,7 +26,9 @@ SYMBOL: insomniac-recipients
] with-scope ; inline
: email-subject ( service -- string )
[ "[INSOMNIAC] " % % " on " % host-name % ] "" make ;
[
"[INSOMNIAC] " % % " on " % io.sockets:host-name %
] "" make ;
: (email-log-report) ( service word-names -- )
[