프록시 코드 디버그에 사용할 로그 구현

Rational® Functional Tester는 개발된 프록시 코드를 디버깅하는 동안 사용할 수 있는 로그 기반 구조를 제공합니다. FTDebug 클래스는 Java 및 .Net 프록시 개발 프레임워크 둘 다에 있습니다. 각각의 프록시 클래스에 맞게 FTDebug 클래스 오브젝트를 인스턴스화할 수 있으며 모든 정보, 경고 또는 오류 메시지를 범주별로 기록할 수 있습니다.

시작하기 전에

다음 예제 코드는 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() 클래스의 새 인스턴스가 작성됩니다. 로깅 및 추적 페이지의 컴포넌트 설정 추적을 사용하여 실행 중 생성된 정보의 추적 레벨을 제어할 수 있습니다. 자세한 정보는 로깅 및 추적 페이지를 참조하십시오.


피드백