]> gitweb.factorcode.org Git - factor.git/commitdiff
fix logging check, unit tests
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 18 Feb 2009 19:35:55 +0000 (13:35 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 18 Feb 2009 19:35:55 +0000 (13:35 -0600)
basis/logging/logging-tests.factor
basis/logging/logging.factor

index 796c8769fc295febb25e4c7a84dddb41bce993fa..63eecc73191ee1cfd6bd4f051c0dd099c4289bf1 100644 (file)
@@ -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
index 238938907461d85f4e7a8f49bea9b38b6b07cb0e..496dae2c612fb59cc4d8e58613be8562592abbcd 100644 (file)
@@ -33,14 +33,16 @@ ERROR: undefined-log-level ;
 \r
 SYMBOL: log-service\r
 \r
+ERROR: bad-log-message-parameters msg word level ;\r
+\r
 : check-log-message ( msg word level -- msg word level )\r
     3dup [ string? ] [ word? ] [ word? ] tri* and and\r
-    [ "Bad parameters to log-message" throw ] unless ; inline\r
+    [ bad-log-message-parameters ] unless ; inline\r
 \r
 : log-message ( msg word level -- )\r
     check-log-message\r
-    dup log?\r
-    log-service get dup and [\r
+    log-service get\r
+    2dup [ log? ] [ ] bi* and [\r
         [ [ string-lines ] [ name>> ] [ name>> ] tri* ] dip\r
         4array "log-message" send-to-log-server\r
     ] [\r