【问题标题】:How to set the viewer environment to be local and log level to debug如何将查看器环境设置为本地和日志级别以进行调试
【发布时间】:2017-08-11 17:35:16
【问题描述】:

我在查看器中看到了以下代码:

avp.LogLevels = {
    DEBUG: 5,
    LOG: 4,
    INFO: 3,
    WARNING: 2,
    ERROR: 1,
    NONE: 0
};

还有:

avp.initializeProtein = function () {

    //For local work, don't redirect texture requests to the CDN,
    //because local ones will load much faster, presumably.
    if (avp.ENABLE_DEBUG && avp.env == "Local" && !auth /* when auth is true, the viewer is operating under

如何将avp.env设置为Local并设置日志级别?

【问题讨论】:

    标签: autodesk autodesk-forge autodesk-viewer


    【解决方案1】:

    你可以看看我关于online/offline use of the viewer API的博文

    日志级别使用:

    Autodesk.Viewing.Private.logger.setLevel(5) //debug
    

    【讨论】:

    • logger 调试级别给出什么样的信息?
    【解决方案2】:

    初始化查看器时,将envdocument 选项作为本地资源传递。

    function initialize() {
        var options = {
            'document' : './shaver/0.svf',
            'env':'Local'
            };
    
        var viewerElement = document.getElementById('viewer');
    
        viewer = new Autodesk.Viewing.Private.GuiViewer3D(viewerElement, {});
    
        Autodesk.Viewing.Initializer(options,function() {
        viewer.initialize();
        viewer.load(options.document);
        });
    }
    

    【讨论】:

    • 那么在选项中添加LogLevels 也应该这样设置?
    • 另外,我已经在设置中设置了,但没有返回:i.imgur.com/OT0b0Fs.png,你确定它是相同的env
    猜你喜欢
    • 2013-02-15
    • 2021-01-13
    • 1970-01-01
    • 2022-11-11
    • 2018-05-31
    • 2023-03-18
    • 2020-06-20
    • 1970-01-01
    • 2021-04-06
    相关资源
    最近更新 更多