Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Log Text OpenerNew to Visual Studio Code? Get it now.
Log Text Opener

Log Text Opener

wuyuye

| (0) | Free
Opens .log files in a tolerant text preview even when VS Code would normally treat them as binary or unsupported.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Log Text Opener

一个最小的 VS Code 扩展:接管 .log 文件的打开动作,并将其转成可容错的只读文本预览;即使 VS Code 原本把它识别成二进制或不支持的编码,也能直接看到文本内容。

功能

  • 关联扩展名:.log
  • 打开方式:自动跳转到只读文本预览
  • 语言 ID:log-text
  • 容错解码:优先 UTF-8,识别 UTF-16 LE/BE BOM,必要时回退到 latin1

开发

npm install
npm run compile

按 F5 启动扩展开发宿主后,打开任意 .log 文件即可验证。

如果你想手动把当前文件重新按文本预览打开,可以在命令面板执行 Log Text Opener: Open As Text Preview。

打包

npm run package

扩展更多后缀

如需支持更多后缀,先编辑 package.json 中的 contributes.languages[0].extensions,例如:

"extensions": [".log", ".out", ".trace"]

如果要让这些后缀也默认走自定义文本预览,还需要同步修改 package.json 中 contributes.customEditors[0].selector 和 src/extension.ts 里的文件监听规则。

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft