File tree Expand file tree Collapse file tree 6 files changed +46
-22
lines changed Expand file tree Collapse file tree 6 files changed +46
-22
lines changed Original file line number Diff line number Diff line change 1880
1880
"svgo" : " ^4.0.0" ,
1881
1881
"tsx" : " ^4.20.3" ,
1882
1882
"typescript" : " ^5.8.3" ,
1883
- "winston" : " ^3.17.0"
1883
+ "winston" : " ^3.17.0" ,
1884
+ "winston-transport" : " ^4.9.0"
1884
1885
},
1885
1886
"dependencies" : {
1886
1887
"@vscode/codicons" : " ^0.0.38" ,
Original file line number Diff line number Diff line change 12
12
//
13
13
//===----------------------------------------------------------------------===//
14
14
import * as vscode from "vscode" ;
15
- import * as Transport from "winston-transport" ;
15
+ import * as TransportType from "winston-transport" ;
16
+
17
+ // Compile error if don't use "require": https://github.com/swiftlang/vscode-swift/actions/runs/16529946578/job/46752753379?pr=1746
18
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
19
+ const Transport : typeof TransportType = require ( "winston-transport" ) ;
16
20
17
21
export class OutputChannelTransport extends Transport {
18
22
private appending : boolean = false ;
Original file line number Diff line number Diff line change 12
12
//
13
13
//===----------------------------------------------------------------------===//
14
14
import * as vscode from "vscode" ;
15
- import * as Transport from "winston-transport" ;
16
15
17
16
export class RollingLog implements vscode . Disposable {
18
17
private _logs : ( string | null ) [ ] ;
@@ -79,20 +78,3 @@ export class RollingLog implements vscode.Disposable {
79
78
this . logCount = 1 ;
80
79
}
81
80
}
82
-
83
- export class RollingLogTransport extends Transport {
84
- constructor ( private readonly rollingLog : RollingLog ) {
85
- super ( ) ;
86
- this . level = "info" ; // This log is used for testing, we
87
- }
88
-
89
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
90
- public log ( info : any , next : ( ) => void ) : void {
91
- if ( info . append ) {
92
- this . rollingLog . append ( info . message ) ;
93
- } else {
94
- this . rollingLog . appendLine ( info . message ) ;
95
- }
96
- next ( ) ;
97
- }
98
- }
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the VS Code Swift open source project
4
+ //
5
+ // Copyright (c) 2025 the VS Code Swift project authors
6
+ // Licensed under Apache License v2.0
7
+ //
8
+ // See LICENSE.txt for license information
9
+ // See CONTRIBUTORS.txt for the list of VS Code Swift project authors
10
+ //
11
+ // SPDX-License-Identifier: Apache-2.0
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+ import * as TransportType from "winston-transport" ;
15
+ import { RollingLog } from "./RollingLog" ;
16
+
17
+ // Compile error if don't use "require": https://github.com/swiftlang/vscode-swift/actions/runs/16529946578/job/46752753379?pr=1746
18
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
19
+ const Transport : typeof TransportType = require ( "winston-transport" ) ;
20
+
21
+ export class RollingLogTransport extends Transport {
22
+ constructor ( private rollingLog : RollingLog ) {
23
+ super ( ) ;
24
+ this . level = "info" ; // This log is used for testing, we
25
+ }
26
+
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
+ public log ( info : any , next : ( ) => void ) : void {
29
+ if ( info . append ) {
30
+ this . rollingLog . append ( info . message ) ;
31
+ } else {
32
+ this . rollingLog . appendLine ( info . message ) ;
33
+ }
34
+ next ( ) ;
35
+ }
36
+ }
Original file line number Diff line number Diff line change 15
15
import * as vscode from "vscode" ;
16
16
import * as winston from "winston" ;
17
17
import { RollingLog } from "./RollingLog" ;
18
- import { RollingLogTransport } from "./RollingLog " ;
18
+ import { RollingLogTransport } from "./RollingLogTransport " ;
19
19
import { IS_RUNNING_UNDER_TEST } from "../utilities/utilities" ;
20
20
import { OutputChannelTransport } from "./OutputChannelTransport" ;
21
21
import configuration from "../configuration" ;
You can’t perform that action at this time.
0 commit comments