[dev.clj]: (with-logging-status) on start

This commit is contained in:
anatoly 2015-11-23 13:28:17 -05:00
parent 357069bef1
commit bbf06c46b1
2 changed files with 8 additions and 15 deletions

View file

@ -1,8 +1,6 @@
(ns dev
"Tools for interactive development with the REPL. This file should
not be included in a production build of the application."
;; (:use [cljs.repl :only [repl]]
;; [cljs.repl.browser :only [repl-env]])
not be included in a production build of the application."
(:require [clojure.java.io :as io]
[clojure.java.javadoc :refer [javadoc]]
[clojure.pprint :refer [pprint]]
@ -11,7 +9,6 @@
[clojure.set :as set]
[clojure.string :as str]
[clojure.test :as test]
;; [clojure.core.async :refer [>!! <!! >! <! go-loop alt! timeout]]
[clojure.tools.namespace.repl :as tn]
[check.parts-test]
[check.start-with-test]
@ -21,6 +18,7 @@
[app :refer [create-nyse-schema find-orders add-order]])) ;; <<<< replace this your "app" namespace(s) you want to be available at REPL time
(defn start []
(with-logging-status)
(mount/start-without #'check.start-with-test/test-conn
#'check.start-with-test/test-nrepl
#'check.parts-test/should-not-start

View file

@ -1,5 +1,6 @@
(ns app.utils.logging
(:require [robert.hooke :refer [add-hook clear-hooks]]
(ns app.utils.logging ;; << change to your namespace/path
(:require [mount.core]
[robert.hooke :refer [add-hook clear-hooks]]
[clojure.string :refer [split]]
[clojure.tools.logging :refer [info]]))
@ -37,15 +38,9 @@
#'mount.core/sigstop
#'mount.core/sigcont})
(defn with-logging-status []
(doall (map #(add-hook % log-status) lifecycle-fns)))
(defn without-logging-status []
(doall (map #(clear-hooks %) lifecycle-fns)))
;; here is just to illustrate lificycle of states in REPL
;; if needed in reality will be called in "-main" or another entry point
(without-logging-status)
(with-logging-status)
(defn with-logging-status []
(without-logging-status)
(doall (map #(add-hook % log-status) lifecycle-fns)))