How to change the level of AX info messages

纵饮孤独 提交于 2019-12-05 02:15:50

setPrefix in AX sets (adds) the prefix for the current execution scope, and when leaving the scope the prefix is automatically reset to the previous level. You can use getPrefix to check the current execution prefix.

2 hacks can help you recieve the expected result:

#1

static void TestJob(Args _args)
{
    void sub1()
    {
        setprefix("Prefix");
        info("Info1");
        info("Info2");
    }

    void sub2()
    {
        setprefix("Prefix2");
        info("Info3");
    }
    ;

    setPrefix("Main");
    sub1();
    sub2();
}

#2

static void TestJob(Args _args)
{
    setPrefix("Main");
    info("Prefix\tInfo1");
    info("Prefix\tInfo2");
    info("Prefix2\tInfo3");
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!