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

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()");
	}
}

이 예제에서 FtDebug() 메소드가 myproxies 문자열을 전달합니다. C:\Program Files\IBM\SDP70\FunctionalTester\bin\에 있는 ivory.properties 파일에서 이 문자열을 사용하여 실행 시 생성되는 로그 정보 레벨을 제어할 수 있습니다. 다음 예제 코드는 ivory.properties 파일에서 myproxies 문자열을 이용하는 방법을 보여줍니다.

###
### Debugging options
###
# The following propeties are used to control the debugging output generated by the FT
# product.  In production versions this output is minimal, limited primarily to error
# and warning level information.
rational.test.ft.debug.enabled=true
rational.test.ft.debug.clear_on_init=false
rational.test.ft.debug.filename=c:/ivDebug.txt
# filter levels: error,0;warning,1;debug,2;verbose,3
rational.test.ft.debug.filter=default,1;myproxies,3;
이 예제에서 myproxies 문자열의 값은 3으로 설정됩니다. 이런 방법으로 ivDebug.txt 파일에 저장되는 디버깅 정보의 레벨을 제어할 수 있습니다.

피드백