@@ -19,7 +19,7 @@ export enum LogLevel {
1919 * This will allow for easy mocking of the logger during unit tests.
2020 */
2121export interface ILogger {
22- getLogFilePath ( baseName : string ) : vscode . Uri ;
22+ logDirectoryPath : vscode . Uri ;
2323 updateLogLevel ( logLevelName : string ) : void ;
2424 write ( message : string , ...additionalMessages : string [ ] ) : void ;
2525 writeAndShowInformation ( message : string , ...additionalMessages : string [ ] ) : Promise < void > ;
@@ -35,12 +35,11 @@ export interface ILogger {
3535}
3636
3737export class Logger implements ILogger {
38- public logDirectoryPath : vscode . Uri ;
39-
38+ public logDirectoryPath : vscode . Uri ; // The folder for all the logs
4039 private logLevel : LogLevel ;
4140 private commands : vscode . Disposable [ ] ;
4241 private logChannel : vscode . OutputChannel ;
43- private logFilePath : vscode . Uri ;
42+ private logFilePath : vscode . Uri ; // The client's logs
4443 private logDirectoryCreated = false ;
4544 private writingLog = false ;
4645
@@ -53,7 +52,7 @@ export class Logger implements ILogger {
5352 globalStorageUri . with ( { scheme : "file" } ) ,
5453 "logs" ,
5554 `${ Math . floor ( Date . now ( ) / 1000 ) } -${ vscode . env . sessionId } ` ) ;
56- this . logFilePath = this . getLogFilePath ( "vscode-powershell" ) ;
55+ this . logFilePath = vscode . Uri . joinPath ( this . logDirectoryPath , "vscode-powershell.log " ) ;
5756
5857 // Early logging of the log paths for debugging.
5958 if ( LogLevel . Diagnostic >= this . logLevel ) {
@@ -79,10 +78,6 @@ export class Logger implements ILogger {
7978 }
8079 }
8180
82- public getLogFilePath ( baseName : string ) : vscode . Uri {
83- return vscode . Uri . joinPath ( this . logDirectoryPath , `${ baseName } .log` ) ;
84- }
85-
8681 private writeAtLevel ( logLevel : LogLevel , message : string , ...additionalMessages : string [ ] ) : void {
8782 if ( logLevel >= this . logLevel ) {
8883 void this . writeLine ( message , logLevel ) ;
0 commit comments