当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript vscode-chrome-debug-core.Logger类代码示例

本文整理汇总了TypeScript中vscode-chrome-debug-core.Logger的典型用法代码示例。如果您正苦于以下问题:TypeScript Logger类的具体用法?TypeScript Logger怎么用?TypeScript Logger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Logger类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: attach

    public attach(args: any): Promise<void> {
        this.initializeLogging('attach-edge', arguments);
        Logger.log(`Attaching to Edge`);

        return this._launchAdapter(args).then((attachArgs:any) =>{
            return super.attach(attachArgs);
        });
    }
开发者ID:modulexcite,项目名称:vscode-edge-debug,代码行数:8,代码来源:edgeDebugAdapter.ts

示例2: _launchAdapter

    //private _launchAdapter(url?:string, port?:number, adapterExePath?:string ):Promise<any> {
    private _launchAdapter(args?:any):Promise<any> {
        this.initializeLogging('launch-adapter', arguments);
        let adapterExePath = args.runtimeExecutable;
        if (!adapterExePath) {
            adapterExePath = edgeUtils.getAdapterPath();
        }

        Logger.log(`Launching adapter at: '${adapterExePath}', ${JSON.stringify(arguments) })`);
        // Check exists
        if (!fs.existsSync(adapterExePath)) {
            if (Utils.getPlatform() == Utils.Platform.Windows) {
                return Utils.errP(`No Edge Diagnostics Adapter was found. Install the Edge Diagnostics Adapter (https://github.com/Microsoft/edge-diagnostics-adapter) and specify a valid 'adapterExecutable' path`);
            } else {
                return Utils.errP(`Edge debugging is only supported on Windows 10.`);
            }
        }

        let adapterArgs:string[] = [];
        if (!args.port) {
            args.port = 9222;
        }
        // We always tell the adpater what port to listen on so there's no shared info between the adapter and the extension
        let portCmdArg = '--port=' + args.port;
        adapterArgs.push(portCmdArg);

        if(args.url){
            let launchUrlArg = '--launch='+ args.url;
            adapterArgs.push(launchUrlArg);
        }

        // The adapter might already be running if so don't spawn a new one
        return Utils.getURL(`http://127.0.0.1:${args.port}/json/version`).then((jsonResponse:any) => {
            try {
                const responseArray = JSON.parse(jsonResponse);
                let targetBrowser:string = responseArray.Browser;
                targetBrowser = targetBrowser.toLocaleLowerCase();
                if(targetBrowser.indexOf('edge') > -1){
                    return Promise.resolve(args);
                }

                return Utils.errP(`Sever for ${targetBrowser} already listening on :9222`);
            } catch (ex) {
                return Utils.errP(`Sever already listening on :9222 returned ${ex}`);
            }

        }, error => {
            Logger.log(`spawn('${adapterExePath}', ${JSON.stringify(adapterArgs) })`);
            this._adapterProc = childProcess.execFile(adapterExePath, adapterArgs, (err) => {
                    Logger.log(`Adapter error: ${err}`);
                    this.terminateSession();
                }, (data) => {
                    Logger.log(`Adapter output: ${data}`);
            });

            return Promise.resolve(args);
        });
    }
开发者ID:modulexcite,项目名称:vscode-edge-debug,代码行数:58,代码来源:edgeDebugAdapter.ts

示例3:

        }, error => {
            Logger.log(`spawn('${adapterExePath}', ${JSON.stringify(adapterArgs) })`);
            this._adapterProc = childProcess.execFile(adapterExePath, adapterArgs, (err) => {
                    Logger.log(`Adapter error: ${err}`);
                    this.terminateSession();
                }, (data) => {
                    Logger.log(`Adapter output: ${data}`);
            });

            return Promise.resolve(args);
        });
开发者ID:modulexcite,项目名称:vscode-edge-debug,代码行数:11,代码来源:edgeDebugAdapter.ts

示例4: launch

    public launch(args: any): Promise<void> {
        this.initializeLogging('launch-edge', arguments);
        Logger.log(`Launching Edge`);

        let launchUrl: string;
        if (args.file) {
            launchUrl = 'file:///' + path.resolve(args.cwd, args.file);
        } else if (args.url) {
            launchUrl = args.url;
        }

        return this._launchAdapter(args).then((attachArgs:any) =>{
            return super.attach(attachArgs);
        });
    }
开发者ID:modulexcite,项目名称:vscode-edge-debug,代码行数:15,代码来源:edgeDebugAdapter.ts


注:本文中的vscode-chrome-debug-core.Logger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。