Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8fb5b41

Browse files
authored
add winston-transport-vscode to transports docs (#2411)
1 parenta326743 commit8fb5b41

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

‎docs/transports.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ there are additional transports written by
5959
*[SQLite3](#sqlite3-transport)
6060
*[SSE with KOA 2](#sse-transport-with-koa-2)
6161
*[Sumo Logic](#sumo-logic-transport)
62+
*[VS Code extension](#vscode-extension)
6263
*[Worker Thread based async Console transport](#worker-thread-based-async-console-transport)
6364
*[Winlog2 Transport](#winlog2-transport)
6465

@@ -832,6 +833,40 @@ Options:
832833
###SSE transport with KOA 2
833834
[winston-koa-sse](https://github.com/alexvictoor/winston-koa-sse) is a transport that leverages on Server Sent Event. With this transport you can use your browser console to view your server logs.
834835

836+
###VS Code extension
837+
838+
[winston-transport-vscode][48] is a transport for VS Code extension development.
839+
840+
```js
841+
constvscode=require('vscode');
842+
constwinston=require('winston');
843+
const {OutputChannelTransport }=require('winston-transport-vscode');
844+
845+
constoutputChannel=vscode.window.createOutputChannel('My extension');
846+
847+
constlogger=winston.createLogger({
848+
transports: [newOutputChannelTransport({ outputChannel })],
849+
});
850+
```
851+
852+
The extension includes dedicated log levels and format for using with VS Code's
853+
LogOutputChannel.
854+
855+
```js
856+
const {LogOutputChannelTransport }=require('winston-transport-vscode');
857+
858+
constoutputChannel=vscode.window.createOutputChannel('My extension', {
859+
log:true,
860+
});
861+
862+
constlogger=winston.createLogger({
863+
levels:LogOutputChannelTransport.config.levels,
864+
format:LogOutputChannelTransport.format(),
865+
transports: [newLogOutputChannelTransport({ outputChannel })],
866+
});
867+
```
868+
869+
835870
###Worker Thread based async Console transport
836871

837872
[winston-console-transport-in-worker][46]
@@ -1015,3 +1050,4 @@ That's why we say it's a logger for just about everything
10151050
[45]:https://github.com/datalust/winston-seq
10161051
[46]:https://github.com/arpad1337/winston-console-transport-in-worker
10171052
[47]:https://github.com/kimnetics/winston-newrelic-agent-transport
1053+
[48]:https://github.com/loderunner/winston-transport-vscode

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp