@@ -10,7 +10,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
1010import { IWindowsService , IWindowService } from 'vs/platform/windows/common/windows' ;
1111import { TPromise } from 'vs/base/common/winjs.base' ;
1212import { IQuickOpenService , IPickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen' ;
13- import { ILogService , LogLevel } from 'vs/platform/log/common/log' ;
13+ import { ILogService , LogLevel , DEFAULT_LOG_LEVEL } from 'vs/platform/log/common/log' ;
1414import { IOutputService , COMMAND_OPEN_LOG_VIEWER } from 'vs/workbench/parts/output/common/output' ;
1515import * as Constants from 'vs/workbench/parts/logs/common/logConstants' ;
1616import { ICommandService } from 'vs/platform/commands/common/commands' ;
@@ -108,14 +108,15 @@ export class SetLogLevelAction extends Action {
108108 }
109109
110110 run ( ) : TPromise < void > {
111+ const current = this . logService . getLevel ( ) ;
111112 const entries = [
112- { label : nls . localize ( 'trace' , "Trace" ) , level : LogLevel . Trace } ,
113- { label : nls . localize ( 'debug' , "Debug" ) , level : LogLevel . Debug } ,
114- { label : nls . localize ( 'info' , "Info" ) , level : LogLevel . Info } ,
115- { label : nls . localize ( 'warn' , "Warning" ) , level : LogLevel . Warning } ,
116- { label : nls . localize ( 'err' , "Error" ) , level : LogLevel . Error } ,
117- { label : nls . localize ( 'critical' , "Critical" ) , level : LogLevel . Critical } ,
118- { label : nls . localize ( 'off' , "Off" ) , level : LogLevel . Off }
113+ { label : nls . localize ( 'trace' , "Trace" ) , level : LogLevel . Trace , description : this . getDescription ( LogLevel . Trace , current ) } ,
114+ { label : nls . localize ( 'debug' , "Debug" ) , level : LogLevel . Debug , description : this . getDescription ( LogLevel . Debug , current ) } ,
115+ { label : nls . localize ( 'info' , "Info" ) , level : LogLevel . Info , description : this . getDescription ( LogLevel . Info , current ) } ,
116+ { label : nls . localize ( 'warn' , "Warning" ) , level : LogLevel . Warning , description : this . getDescription ( LogLevel . Warning , current ) } ,
117+ { label : nls . localize ( 'err' , "Error" ) , level : LogLevel . Error , description : this . getDescription ( LogLevel . Error , current ) } ,
118+ { label : nls . localize ( 'critical' , "Critical" ) , level : LogLevel . Critical , description : this . getDescription ( LogLevel . Critical , current ) } ,
119+ { label : nls . localize ( 'off' , "Off" ) , level : LogLevel . Off , description : this . getDescription ( LogLevel . Off , current ) } ,
119120 ] ;
120121
121122 return this . quickOpenService . pick ( entries , { placeHolder : nls . localize ( 'selectLogLevel' , "Select log level" ) , autoFocus : { autoFocusIndex : this . logService . getLevel ( ) } } ) . then ( entry => {
@@ -124,4 +125,17 @@ export class SetLogLevelAction extends Action {
124125 }
125126 } ) ;
126127 }
128+
129+ private getDescription ( level : LogLevel , current : LogLevel ) : string {
130+ if ( DEFAULT_LOG_LEVEL === level && current === level ) {
131+ return nls . localize ( 'default and current' , "Default & Current" ) ;
132+ }
133+ if ( DEFAULT_LOG_LEVEL === level ) {
134+ return nls . localize ( 'default' , "Default" ) ;
135+ }
136+ if ( current === level ) {
137+ return nls . localize ( 'current' , "Current" ) ;
138+ }
139+ return void 0 ;
140+ }
127141}
0 commit comments