Skip to content

Instantly share code, notes, and snippets.

@hlship
Created April 21, 2014 15:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlship/11145645 to your computer and use it in GitHub Desktop.
Save hlship/11145645 to your computer and use it in GitHub Desktop.
C3P0 tends to spit out some debugging information at startup. This offends me. I found a way to stop it.
;;; This is a hook for C3P0 to get rid of some garbage it logs to System.err on startup.
(let [err System/err]
(try
(System/setErr (PrintStream. (NullOutputStream.)))
(Class/forName "com.mchange.v2.c3p0.cfg.C3P0Config")
(finally
(System/setErr err))))
@hlship
Copy link
Author

hlship commented Apr 21, 2014

NullOutputStream is from org.apache.commons.io.output (commons-io 2.4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment