다음 예제 코드는 Java에서 프록시 코드에 사용할 로깅을 구현하는 방법을 보여줍니다.
import com.rational.test.ft.util.FtDebug;
.
public class MyProxy extends BaseProxy
{
protected static FtDebug debug = new FtDebug("myproxies");
.
void anyMethod()
{
debug.trace("Beginging of anyMethod()");
.
debug.verbose("I'm doing this!");
.
debug.warning("Not critical, good to have it fixed");
.
debug.error("I shouldn't have been here!!") ;
.
debug.trace("End of anyMethod()");
}
}
다음 예제 코드는 .Net에서 프록시 코드에 사용할 로깅을 구현하는 방법을 보여줍니다.
.
using Rational.Test.Ft.Util;
.
public class MyProxy : BaseProxy
{
protected static FtDebug debug = new FtDebug("myproxies");
.
void anyMethod()
{
debug.Trace("Beginging of anyMethod()");
.
debug.Verbose("I'm doing this!");
.
debug.Warning("Not critical, good to have it fixed");
.
debug.Error("I shouldn't have been here!!") ;
.
debug.Trace("End of anyMethod()");
}
}
이 예제에서는 myproxies라는 FtDebug() 클래스의 새 인스턴스가 작성됩니다. 로깅 및 추적 페이지의 컴포넌트 설정 추적을 사용하여 실행 중 생성된 정보의 추적 레벨을 제어할 수 있습니다. 자세한 정보는 로깅 및 추적 페이지를 참조하십시오.