/** * Register streams for the current thread. */ public static void register(final InputStream in, final PrintStream out, final PrintStream err) { ensureInstalled(); if (log.isTraceEnabled()) { log.trace("Registering: {} -> {}, {}, {}", new Object[] { Thread.currentThread(), in, out, err }); } StreamRegistration prev = registration(false); StreamSet set = new StreamSet(in, out, err); StreamRegistration next = new StreamRegistration(set, prev); registrations.set(next); }