logging.server fixes

db4
Slava Pestov 2008-02-10 01:39:37 -06:00
parent b120abcee2
commit 619d676af6
3 changed files with 9 additions and 5 deletions

View File

@ -42,7 +42,7 @@ SYMBOL: insomniac-recipients
: email-log-report ( service word-names -- )
"logging.insomniac" [ (email-log-report) ] with-logging ;
: schedule-insomniac ( alist -- )
: schedule-insomniac ( service word-names -- )
{ 25 } { 6 } f f f <when> -rot [
[ email-log-report ] assoc-each rotate-logs
] 2curry schedule ;

View File

@ -4,7 +4,7 @@ USING: logging.server sequences namespaces concurrency
words kernel arrays shuffle tools.annotations
prettyprint.config prettyprint debugger io.streams.string
splitting continuations effects arrays.lib parser strings
combinators.lib ;
combinators.lib quotations ;
IN: logging
SYMBOL: DEBUG
@ -112,9 +112,13 @@ PRIVATE>
: log-critical ( error word -- ) CRITICAL (log-error) ;
: stack-balancer ( effect word -- quot )
>r dup effect-in length r> [ over >r ERROR log-stack r> ndrop ] 2curry
swap effect-out length f <repetition> append >quotation ;
: error-logging-quot ( quot word -- quot' )
dup stack-effect effect-in length
[ >r log-error r> ndrop ] 2curry
[ [ log-error ] curry ] keep
[ stack-effect ] keep stack-balancer compose
[ recover ] 2curry ;
: add-error-logging ( word level -- )

View File

@ -84,7 +84,7 @@ SYMBOL: log-files
(close-logs)
log-root directory [ drop rotate-log ] assoc-each ;
: log-server-loop
: log-server-loop ( -- )
[
receive unclip {
{ "log-message" [ (log-message) ] }