/*
* SalomeTMF is a Test Management Framework
* Copyright (C) 2005 France Telecom R&D
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @author Fayal SOUGRATI, Vincent Pautret, Marche Mikael
*
* Contact: mikael.marche@rd.francetelecom.com
*/
package salomeTMF_plug.beanshell;
public class ScriptErrPrint extends java.io.PrintStream {
java.io.PrintStream p;
String log = "";
public String getLog(){
return log;
}
public void setLog(String l){
log += "\n" + l;
}
public ScriptErrPrint(java.io.PrintStream p) {
super(System.out);
this.p = p;
}
public boolean checkError() {
return p.checkError();
}
public void close() {
p.close();
}
public void flush() {
p.flush();
}
public void print(boolean b) {
p.print(b);
log += b;
}
public void print(char c){
p.print(c);
log += c;
}
public void print(char[] s){
p.print(s);
log += s;
}
public void print(double d){
p.print(d);
log += d;
}
public void print(float f){
p.print(f);
log += f;
}
public void print(int i){
p.print(i);
log += i;
}
public void print(long l){
p.print(l);
log += l;
}
public void print(Object obj){
p.print(obj);
log += obj;
}
public void print(String s){
p.print(s);
log += s;
}
public void println(){
p.println();
log += "\n";
}
public void println(boolean x){
p.println(x);
log += x + "\n";
}
public void println(char x){
p.println(x);
log += x + "\n";
}
public void println(char[] x){
p.println(x);
log += x + "\n";
}
public void println(double x){
p.println(x);
log += x + "\n";
}
public void println(float x){
p.println(x);
log += x + "\n";
}
public void println(int x){
p.println(x);
log += x + "\n";
}
public void println(long x){
p.println(x);
log += x + "\n";
}
public void println(Object x){
p.println(x);
log += x + "\n";
}
public void println(String x){
p.println(x);
log += x + "\n";
}
public void write(byte[] buf, int off, int len){
p.write(buf, off,len);
log += new String(buf, off, len);
}
public void write(int b){
p.write(b);
log += b;
}
}
|