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 18801880 "svgo" : " ^4.0.0" ,
18811881 "tsx" : " ^4.20.3" ,
18821882 "typescript" : " ^5.8.3" ,
1883- "winston" : " ^3.17.0"
1883+ "winston" : " ^3.17.0" ,
1884+ "winston-transport" : " ^4.9.0"
18841885 },
18851886 "dependencies" : {
18861887 "@vscode/codicons" : " ^0.0.38" ,
Original file line number Diff line number Diff line change 1212//
1313//===----------------------------------------------------------------------===//
1414import * 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" ) ;
1620
1721export class OutputChannelTransport extends Transport {
1822 private appending : boolean = false ;
Original file line number Diff line number Diff line change 1212//
1313//===----------------------------------------------------------------------===//
1414import * as vscode from "vscode" ;
15- import * as Transport from "winston-transport" ;
1615
1716export class RollingLog implements vscode . Disposable {
1817 private _logs : ( string | null ) [ ] ;
@@ -79,20 +78,3 @@ export class RollingLog implements vscode.Disposable {
7978 this . logCount = 1 ;
8079 }
8180}
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 1515import * as vscode from "vscode" ;
1616import * as winston from "winston" ;
1717import { RollingLog } from "./RollingLog" ;
18- import { RollingLogTransport } from "./RollingLog " ;
18+ import { RollingLogTransport } from "./RollingLogTransport " ;
1919import { IS_RUNNING_UNDER_TEST } from "../utilities/utilities" ;
2020import { OutputChannelTransport } from "./OutputChannelTransport" ;
2121import configuration from "../configuration" ;
You can’t perform that action at this time.
0 commit comments