How to temporarily suppress infolog messages in Dynamics Ax (deux)
Good afternoon,
My previous post on the topic was flawed. Here's a better solution when you
want a section of code not to report to the infolog, but still want previous
messages to be shown at the end of execution.
public static void suppressInfolog(Args _args)
{
int i;
;
info("A");
i = infolog.line();
info("B"); //Section of code that will not get reported to the
infolog
if (infolog.line() > i)
infolog.cut(i+1,
infolog.line());
info("C");
}
Only "A" and "C" will be displayed, "B" will have been suppressed.
本文介绍了一种在Dynamics Ax中临时抑制信息日志消息的方法,该方法允许开发者在代码执行期间屏蔽特定部分的日志输出,同时确保之前的消息仍能在执行结束时显示。

被折叠的 条评论
为什么被折叠?



