           (if (and (< depth max-total-depth)
                    (= true (get-in spec [:head :phrasal] true)))
             (lazy-mapcat (fn [parent]
-                           (log/debug (str "parent: " (:rule parent) " over phrasal heads."))
+                           (log/trace (str "lightning-bolts: parent: " (:rule parent) " over phrasal heads."))
                            (mapcat #(over/overh parent %)
                                    (lightning-bolts language-model (get-in parent [:head])
                                                     (+ 1 depth) (+ 1 total-depth)

(ns babel.generate
  (:refer-clojure :exclude [get-in deref resolve find parents])
  (:require
   [babel.index :refer [intersection-with-identity]]
   [babel.over :as over :refer [show-bolt spec-info truncate truncate-expressions]]
   #?(:clj [clojure.tools.logging :as log])
   #?(:cljs [babel.logjs :as log]) 
   [clojure.string :as string]
   [dag_unify.core :refer [copy fail-path get-in fail? strip-refs unify unify!]]))
                                        
;; during generation, will not decend deeper than this when creating a tree:
;; TODO: should also be possible to override per-language.
(def ^:const max-total-depth 6)

;; TODO support setting max-generated-complements to :unlimited
(def ^:const max-generated-complements 20000)

  [language-model spec depth total-depth
                       & {:keys [max-total-depth]
                          :or {max-total-depth max-total-depth}}]
  (if (nil? spec)
    (exception (str "given a null spec for lightning-bolts.")))
  (log/trace (str "lightning-bolts: depth: (" depth "/" max-total-depth ") and spec-info:"
                 (spec-info spec)))
  (let [grammar (:grammar language-model)
        depth (if depth depth 0)
