此示例代码显示如何在 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。您可以使用“记录和跟踪”页面上的“跟踪组件”设置来控制在执行期间发出的跟踪信息的级别。有关更多信息,请参阅“记录和跟踪”页面。