fix logging check, unit tests
parent
6324fb6c13
commit
1045b904be
|
@ -13,7 +13,7 @@ USING: tools.test logging math ;
|
|||
|
||||
\ error-logging-test ERROR add-error-logging
|
||||
|
||||
"logging-test" [
|
||||
"logging-test" DEBUG [
|
||||
[ 4 ] [ 1 3 input-logging-test ] unit-test
|
||||
|
||||
[ 4 ] [ 1 3 output-logging-test ] unit-test
|
||||
|
|
|
@ -33,14 +33,16 @@ ERROR: undefined-log-level ;
|
|||
|
||||
SYMBOL: log-service
|
||||
|
||||
ERROR: bad-log-message-parameters msg word level ;
|
||||
|
||||
: check-log-message ( msg word level -- msg word level )
|
||||
3dup [ string? ] [ word? ] [ word? ] tri* and and
|
||||
[ "Bad parameters to log-message" throw ] unless ; inline
|
||||
[ bad-log-message-parameters ] unless ; inline
|
||||
|
||||
: log-message ( msg word level -- )
|
||||
check-log-message
|
||||
dup log?
|
||||
log-service get dup and [
|
||||
log-service get
|
||||
2dup [ log? ] [ ] bi* and [
|
||||
[ [ string-lines ] [ name>> ] [ name>> ] tri* ] dip
|
||||
4array "log-message" send-to-log-server
|
||||
] [
|
||||
|
|
Loading…
Reference in New Issue