Skip to content

Commit

Permalink
Remove spaces from console logs
Browse files Browse the repository at this point in the history
Continues on from #200
  • Loading branch information
danielcompton committed Jan 17, 2018
1 parent 64f858c commit 17e1637
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/re_frame/cofx.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@
[context]
(if-let [handler (get-handler kind id)]
(update context :coeffects handler)
(console :error "No cofx handler registered for \"" id "\"")))))
(console :error "No cofx handler registered for" id)))))
([id value]
(->interceptor
:id :coeffects
:before (fn coeffects-before
[context]
(if-let [handler (get-handler kind id)]
(update context :coeffects handler value)
(console :error "No cofx handler registered for \"" id "\""))))))
(console :error "No cofx handler registered for" id))))))


;; -- Builtin CoEffects Handlers ---------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/re_frame/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@
;; Assisting the v0.7.x -> v0.8.x transition.
(defn register-handler
[& args]
(console :warn "re-frame: \"register-handler\" has been renamed \"reg-event-db\" (look for registration of " (str (first args)) ")")
(console :warn "re-frame: \"register-handler\" has been renamed \"reg-event-db\" (look for registration of" (str (first args)) ")")
(apply reg-event-db args))

(defn register-sub
[& args]
(console :warn "re-frame: \"register-sub\" is deprecated. Use \"reg-sub-raw\" (look for registration of " (str (first args)) ")")
(console :warn "re-frame: \"register-sub\" is deprecated. Use \"reg-sub-raw\" (look for registration of" (str (first args)) ")")
(apply reg-sub-raw args))
10 changes: 5 additions & 5 deletions src/re_frame/events.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
(make-chain interceptors)
(do ;; do a whole lot of development time checks
(when-not (coll? interceptors)
(console :error "re-frame: when registering " id ", expected a collection of interceptors, got: " interceptors))
(console :error "re-frame: when registering" id ", expected a collection of interceptors, got:" interceptors))
(let [chain (make-chain interceptors)]
(when (empty? chain)
(console :error "re-frame: when registering " id ", given an empty interceptor chain"))
(console :error "re-frame: when registering" id ", given an empty interceptor chain"))
(when-let [not-i (first (remove interceptor/interceptor? chain))]
(if (fn? not-i)
(console :error "re-frame: when registering " id ", got a function instead of an interceptor. Did you provide old style middleware by mistake? Got: " not-i)
(console :error "re-frame: when registering " id ", expected interceptors, but got: " not-i)))
(console :error "re-frame: when registering" id ", got a function instead of an interceptor. Did you provide old style middleware by mistake? Got:" not-i)
(console :error "re-frame: when registering" id ", expected interceptors, but got:" not-i)))
chain)))))


Expand Down Expand Up @@ -56,7 +56,7 @@
(let [event-id (first-in-vector event-v)]
(if-let [interceptors (get-handler kind event-id true)]
(if *handling*
(console :error "re-frame: while handling \"" *handling* "\", dispatch-sync was called for \"" event-v "\". You can't call dispatch-sync within an event handler.")
(console :error "re-frame: while handling" *handling* ", dispatch-sync was called for" event-v ". You can't call dispatch-sync within an event handler.")
(binding [*handling* event-v]
(trace/with-trace {:operation event-id
:op-type kind
Expand Down
2 changes: 1 addition & 1 deletion src/re_frame/fx.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
(doseq [[effect-key effect-value] (:effects context)]
(if-let [effect-fn (get-handler kind effect-key false)]
(effect-fn effect-value)
(console :error "re-frame: no handler registered for effect: \"" effect-key "\". Ignoring."))))))
(console :error "re-frame: no handler registered for effect:" effect-key ". Ignoring."))))))

;; -- Builtin Effect Handlers ------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion src/re_frame/interceptor.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
(if-let [unknown-keys (seq (set/difference
(-> m keys set)
mandatory-interceptor-keys))]
(console :error "re-frame: ->interceptor " m " has unknown keys:" unknown-keys)))
(console :error "re-frame: ->interceptor" m "has unknown keys:" unknown-keys)))
{:id (or id :unnamed)
:before before
:after after })
Expand Down
2 changes: 1 addition & 1 deletion src/re_frame/registrar.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
(let [handler (get-handler kind id)]
(when debug-enabled? ;; This is in a separate `when` so Closure DCE can run ...
(when (and required? (nil? handler)) ;; ...otherwise you'd need to type-hint the `and` with a ^boolean for DCE.
(console :error "re-frame: no " (str kind) " handler registered for: " id)))
(console :error "re-frame: no" (str kind) "handler registered for:" id)))
handler)))


Expand Down
6 changes: 3 additions & 3 deletions src/re_frame/subs.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
(trace/merge-trace! {:tags {:cached? false}})
(if (nil? handler-fn)
(do (trace/merge-trace! {:error true})
(console :error (str "re-frame: no subscription handler registered for: \"" query-id "\". Returning a nil subscription.")))
(console :error (str "re-frame: no subscription handler registered for:" query-id ". Returning a nil subscription.")))
(cache-and-return query [] (handler-fn app-db query)))))))

([query dynv]
Expand All @@ -150,7 +150,7 @@
(console :warn "re-frame: your subscription's dynamic parameters that don't implement IReactiveAtom:" not-reactive)))
(if (nil? handler-fn)
(do (trace/merge-trace! {:error true})
(console :error (str "re-frame: no subscription handler registered for: \"" query-id "\". Returning a nil subscription.")))
(console :error (str "re-frame: no subscription handler registered for:" query-id ". Returning a nil subscription.")))
(let [dyn-vals (make-reaction (fn [] (mapv deref dynv)))
sub (make-reaction (fn [] (handler-fn app-db query @dyn-vals)))]
;; handler-fn returns a reaction which is then wrapped in the sub reaction
Expand Down Expand Up @@ -189,7 +189,7 @@
[signals query-id]
(let [dereffed-signals (map-signals deref signals)]
(when (nil? dereffed-signals)
(console :error "re-frame: in the reg-sub for " query-id ", the input-signals function returns: " signals))
(console :error "re-frame: in the reg-sub for " query-id ", the input-signals function returns:" signals))
(trace/merge-trace! {:tags {:input-signals (doall (to-seq (map-signals reagent-id signals)))}})
dereffed-signals))

Expand Down

0 comments on commit 17e1637

Please sign in to comment.