metosin / malli

High-performance data-driven data specification library for Clojure/Script.
Eclipse Public License 2.0
1.5k stars 211 forks source link

suppress println or log/debug when instrumenting? #689

Open csummers opened 2 years ago

csummers commented 2 years ago

Is there any chance the following lines could be optionally suppressed or be changed to log/debug? When using malli.dev/start! on a large codebase, these create a lot of print statements to stdout/repl.

https://github.com/metosin/malli/blob/3599fbd7fe1eba96c35e5c39073397cba0984b6a/src/malli/instrument.clj#L27

https://github.com/metosin/malli/blob/3599fbd7fe1eba96c35e5c39073397cba0984b6a/src/malli/instrument.clj#L31

Thanks!

ikitommi commented 2 years ago

there is no logging library used, but PR welcome to add an option that disables the printing.

aiba commented 2 years ago

I also am getting a lot of terminal output from these printlns (a testimant to how useful we find malli.experimental/defn!).

I was going to take a stab at a PR to make this optional, but I'm stuck unable to understand how malli.instrument/-strument is getting called by malli.experimental/defn. Perhaps someone could help with this?

I'd also be happy to just ditch the printlns if it's too impractical to make them optional.