]> gitweb.factorcode.org Git - factor.git/commitdiff
logging: let's include the tb when logging errors, makes it way easier
authorBjörn Lindqvist <bjourne@gmail.com>
Thu, 24 Sep 2015 09:43:48 +0000 (11:43 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Thu, 24 Sep 2015 09:43:48 +0000 (11:43 +0200)
to debug!

basis/logging/logging.factor

index 9d0d4abd3a869800da7b4030b414be39618fa59a..0ccc1b25363b2ab8f56059e4b60d29d74baf881b 100644 (file)
@@ -112,12 +112,13 @@ PRIVATE>
 : add-output-logging ( word level -- )
     [ output-logging-quot ] (define-logging) ;
 
+: error>string ( error -- string )
+    [ print-error :c ] with-string-writer ;
+
 : (log-error) ( object word level -- )
     log-service get [
-        [ [ print-error ] with-string-writer ] 2dip log-message
-    ] [
-        2drop rethrow
-    ] if ;
+        [ error>string ] 2dip log-message
+    ] [ 2drop rethrow ] if ;
 
 : log-error ( error word -- ) ERROR (log-error) ;