【问题标题】:Where should logging be done from a Visual Studio Code extension?应该从 Visual Studio Code 扩展在哪里进行日志记录?
【发布时间】:2017-06-14 17:24:03
【问题描述】:

我目前让我的扩展程序将日志数据写入context.storagePath 下的文件。这是我在看到另一个扩展这样做之后模仿的一种方法。

但是,我后来发现 storagePath is undefined when you do not have a folder open 导致我的扩展程序崩溃。

该目的地有时不可用让我觉得我的日志记录不正确。 Visual Studio Code 扩展的正常或典型日志记录目的地是什么?

【问题讨论】:

    标签: logging visual-studio-code vscode-extensions


    【解决方案1】:

    我不确定是否有专门用于 vscode 的典型日志记录目标,但您可以使用系统的临时文件夹,这是许多应用程序所做的。另一个好的位置是用户的家或文档目录。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-22
      • 2016-10-26
      相关资源
      最近更新 更多