From be7fc6f7c974e9e4e9b5f7be63d2cfd5d7f95b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Thu, 24 Sep 2015 11:43:48 +0200 Subject: [PATCH] logging: let's include the tb when logging errors, makes it way easier to debug! --- basis/logging/logging.factor | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/basis/logging/logging.factor b/basis/logging/logging.factor index 9d0d4abd3a..0ccc1b2536 100644 --- a/basis/logging/logging.factor +++ b/basis/logging/logging.factor @@ -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) ;