Java: Hvordan til at omdirigere stderr Og stdout til Commons Logging, med den opkaldende Class
tNameOfCaller (lock); super.println (x); } endelig {lock.unlock (); }}Override Public void println (lang x) {lock.lock (); prøv {setNameOfCaller (lock); super.println (x); } endelig {lock.unlock (); }}Override Public void println (Object x) {lock.lock (); prøv {setNameOfCaller (lock); super.println (x); } endelig {lock.unlock (); }}Override Public void println (String x) {lock.lock (); prøv {setNameOfCaller (lock); super.println (x); } endelig {lock.unlock (); }}Override Public void skrive (byte [] b) kaster IOException {lock.lock (); prøv {setNameOfCaller (lock); super.
write (b); } endelig {lock.unlock (); }}Override Public void skrive (byte [] buf, int fra, int len) {lock.lock (); prøv {setNameOfCaller (lock); super.write (BUF, off, LEN); } endelig {lock.unlock (); }}Override Public void skrive (int b) {lock.lock (); prøv {setNameOfCaller (lock); super.write (b); } endelig {lock.unlock (); }}}