저는 Clojure를 사용하고 있으며 로그 할 수있는 스택 추적을하고 싶습니다 (이상적으로는 String으로 가져오고 싶습니다).stacktrace를 문자열로 얻으십시오.
나는 (.getStackTrace e)
이 StackTraceElement[]
을 반환한다고보고 있지만 의미있는 것을 인쇄하는 방법을 모르겠습니다. 내 두 번째 접근 방식은 PrintWriter를 매개 변수로 사용하여 (.printStackTrace e)
(Java에서 가능하다는 것을 알고 있기 때문에)이지만 올바른 구문을 얻지 못하는 것 같습니다.
감사합니다.
작품을 사용할 수 있습니다. 그냥 내가 첫 번째 문장을 변경하는 걸 썼다. ([clojure.repl : only (pst)] 사용) – sebi