calva icon indicating copy to clipboard operation
calva copied to clipboard

Debugger quits on certain tools.logging forms

Open lowecg opened this issue 1 year ago • 2 comments

When I run a log form that follows a certain pattern from the debugger, the debugger terminates and the function appears to return “QUIT”.

The log runs successfully outside of debugging.

I can repro the issue from the getting started REPL with the following edits:

deps.edn:

{:deps {org.clojure/clojure       {:mvn/version "1.12.0"}
        org.clojure/tools.logging {:mvn/version "1.3.0"}
        org.slf4j/slf4j-simple    {:mvn/version "2.0.16"}}}

hello_repl.clj

(ns get-started.hello-repl
  (:require [clojure.tools.logging :as log]))

"Welcome to the Getting Started REPL! 💜"

(defn debug-this [x]
  ;; these are fine
  (log/info "Plain output ok")
  (println :in 'debug-this :x x) 
  (println "Simple output ok")

  ;; the next line fails on step over (or continue)
  (log/info :in 'debug-this :x x)

  (inc x))

(comment
  (debug-this 1))
  1. Jack-in, and running (debug-this 1) works.
  2. Instrument debug-this using ctrl-alt-c i , then step over the second log/info line and the debugger immediately halts

@PEZ has successfully tried these forms in CIDER and suspects Calva is holding something incorrectly.

Initially discussed here: https://clojurians.slack.com/archives/CBE668G4R/p1726308887145419

lowecg avatar Sep 14 '24 11:09 lowecg