mirror of
https://github.com/taoensso/telemere.git
synced 2025-12-17 01:51:10 +00:00
[fix] [#6] Missing root stack trace
Thanks to @FieryCod for the report!
This commit is contained in:
parent
21c0d5a791
commit
213c6470a7
2 changed files with 11 additions and 6 deletions
|
|
@ -416,7 +416,7 @@
|
||||||
s+nl (enc/sb-appender sb enc/newline)]
|
s+nl (enc/sb-appender sb enc/newline)]
|
||||||
(doseq [st-el (force trace)]
|
(doseq [st-el (force trace)]
|
||||||
(let [{:keys [class method file line]} st-el]
|
(let [{:keys [class method file line]} st-el]
|
||||||
(s+nl class "/" method " at " file ":" line)))
|
(s+nl " " class "/" method " at " file ":" line)))
|
||||||
(str sb))))
|
(str sb))))
|
||||||
|
|
||||||
(comment (println (format-clj-stacktrace (:trace (enc/ex-map (ex-info "Ex2" {:k2 "v2"} (ex-info "Ex1" {:k1 "v1"})))))))
|
(comment (println (format-clj-stacktrace (:trace (enc/ex-map (ex-info "Ex2" {:k2 "v2"} (ex-info "Ex1" {:k1 "v1"})))))))
|
||||||
|
|
@ -447,7 +447,7 @@
|
||||||
(when trace
|
(when trace
|
||||||
(s+ nl nl "Root stack trace:" nl)
|
(s+ nl nl "Root stack trace:" nl)
|
||||||
#?(:cljs (s+ trace)
|
#?(:cljs (s+ trace)
|
||||||
:clj (format-clj-stacktrace trace)))
|
:clj (s+ (format-clj-stacktrace trace))))
|
||||||
|
|
||||||
(str sb)))))))
|
(str sb)))))))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -670,10 +670,15 @@
|
||||||
(is (= ((utils/format-nsecs-fn) 1.5e9) "1.50s")) ; More tests in Encore
|
(is (= ((utils/format-nsecs-fn) 1.5e9) "1.50s")) ; More tests in Encore
|
||||||
(is (= ((utils/format-inst-fn) t0) "2024-06-09T21:15:20.170Z"))
|
(is (= ((utils/format-inst-fn) t0) "2024-06-09T21:15:20.170Z"))
|
||||||
|
|
||||||
(is (enc/str-starts-with? ((utils/format-error-fn) ex2)
|
(testing "format-error-fn"
|
||||||
|
(let [ex2-str ((utils/format-error-fn) ex2)]
|
||||||
|
[(is (enc/str-starts-with? ex2-str
|
||||||
#?(:clj " Root: clojure.lang.ExceptionInfo - Ex1\n data: {:k1 \"v1\"}\n\nCaused: clojure.lang.ExceptionInfo - Ex2\n data: {:k2 \"v2\"}\n\nRoot stack trace:\n"
|
#?(:clj " Root: clojure.lang.ExceptionInfo - Ex1\n data: {:k1 \"v1\"}\n\nCaused: clojure.lang.ExceptionInfo - Ex2\n data: {:k2 \"v2\"}\n\nRoot stack trace:\n"
|
||||||
:cljs " Root: cljs.core/ExceptionInfo - Ex1\n data: {:k1 \"v1\"}\n\nCaused: cljs.core/ExceptionInfo - Ex2\n data: {:k2 \"v2\"}\n\nRoot stack trace:\n")))
|
:cljs " Root: cljs.core/ExceptionInfo - Ex1\n data: {:k1 \"v1\"}\n\nCaused: cljs.core/ExceptionInfo - Ex2\n data: {:k2 \"v2\"}\n\nRoot stack trace:\n")))
|
||||||
|
|
||||||
|
(is (enc/str-contains? ex2-str "Root stack trace:"))
|
||||||
|
(is (enc/str-contains? ex2-str "invoke") "Root stack trace includes content")]))
|
||||||
|
|
||||||
(testing "signal-preamble-fn"
|
(testing "signal-preamble-fn"
|
||||||
(let [sig (with-sig (tel/event! ::ev-id {:inst t0}))
|
(let [sig (with-sig (tel/event! ::ev-id {:inst t0}))
|
||||||
preamble ((utils/signal-preamble-fn) sig)] ; "2024-06-09T21:15:20.170Z INFO EVENT taoensso.telemere-tests(592,35) ::ev-id"
|
preamble ((utils/signal-preamble-fn) sig)] ; "2024-06-09T21:15:20.170Z INFO EVENT taoensso.telemere-tests(592,35) ::ev-id"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue