Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9f22d84b
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9f22d84b
编写于
1月 26, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Identify current and default log levels in the log level picker
上级
652077a7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
12 deletion
+28
-12
src/vs/platform/log/common/log.ts
src/vs/platform/log/common/log.ts
+6
-4
src/vs/workbench/parts/logs/electron-browser/logsActions.ts
src/vs/workbench/parts/logs/electron-browser/logsActions.ts
+22
-8
未找到文件。
src/vs/platform/log/common/log.ts
浏览文件 @
9f22d84b
...
...
@@ -23,6 +23,8 @@ export enum LogLevel {
Off
}
export
const
DEFAULT_LOG_LEVEL
:
LogLevel
=
LogLevel
.
Info
;
export
interface
ILogService
extends
IDisposable
{
_serviceBrand
:
any
;
onDidChangeLogLevel
:
Event
<
LogLevel
>
;
...
...
@@ -39,7 +41,7 @@ export interface ILogService extends IDisposable {
export
abstract
class
AbstractLogService
extends
Disposable
{
private
level
:
LogLevel
=
LogLevel
.
Error
;
private
level
:
LogLevel
=
DEFAULT_LOG_LEVEL
;
private
readonly
_onDidChangeLogLevel
:
Emitter
<
LogLevel
>
=
this
.
_register
(
new
Emitter
<
LogLevel
>
());
readonly
onDidChangeLogLevel
:
Event
<
LogLevel
>
=
this
.
_onDidChangeLogLevel
.
event
;
...
...
@@ -60,7 +62,7 @@ export class ConsoleLogMainService extends AbstractLogService implements ILogSer
_serviceBrand
:
any
;
private
useColors
:
boolean
;
constructor
(
logLevel
:
LogLevel
=
LogLevel
.
Error
)
{
constructor
(
logLevel
:
LogLevel
=
DEFAULT_LOG_LEVEL
)
{
super
();
this
.
setLevel
(
logLevel
);
this
.
useColors
=
!
isWindows
;
...
...
@@ -135,7 +137,7 @@ export class ConsoleLogService extends AbstractLogService implements ILogService
_serviceBrand
:
any
;
constructor
(
logLevel
:
LogLevel
=
LogLevel
.
Error
)
{
constructor
(
logLevel
:
LogLevel
=
DEFAULT_LOG_LEVEL
)
{
super
();
this
.
setLevel
(
logLevel
);
}
...
...
@@ -322,5 +324,5 @@ export function getLogLevel(environmentService: IEnvironmentService): LogLevel {
return
LogLevel
.
Off
;
}
}
return
LogLevel
.
Info
;
return
DEFAULT_LOG_LEVEL
;
}
\ No newline at end of file
src/vs/workbench/parts/logs/electron-browser/logsActions.ts
浏览文件 @
9f22d84b
...
...
@@ -10,7 +10,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import
{
IWindowsService
,
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IQuickOpenService
,
IPickOpenEntry
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
ILogService
,
LogLevel
}
from
'
vs/platform/log/common/log
'
;
import
{
ILogService
,
LogLevel
,
DEFAULT_LOG_LEVEL
}
from
'
vs/platform/log/common/log
'
;
import
{
IOutputService
,
COMMAND_OPEN_LOG_VIEWER
}
from
'
vs/workbench/parts/output/common/output
'
;
import
*
as
Constants
from
'
vs/workbench/parts/logs/common/logConstants
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
...
...
@@ -108,14 +108,15 @@ export class SetLogLevelAction extends Action {
}
run
():
TPromise
<
void
>
{
const
current
=
this
.
logService
.
getLevel
();
const
entries
=
[
{
label
:
nls
.
localize
(
'
trace
'
,
"
Trace
"
),
level
:
LogLevel
.
Trace
},
{
label
:
nls
.
localize
(
'
debug
'
,
"
Debug
"
),
level
:
LogLevel
.
Debug
},
{
label
:
nls
.
localize
(
'
info
'
,
"
Info
"
),
level
:
LogLevel
.
Info
},
{
label
:
nls
.
localize
(
'
warn
'
,
"
Warning
"
),
level
:
LogLevel
.
Warning
},
{
label
:
nls
.
localize
(
'
err
'
,
"
Error
"
),
level
:
LogLevel
.
Error
},
{
label
:
nls
.
localize
(
'
critical
'
,
"
Critical
"
),
level
:
LogLevel
.
Critical
},
{
label
:
nls
.
localize
(
'
off
'
,
"
Off
"
),
level
:
LogLevel
.
Off
}
{
label
:
nls
.
localize
(
'
trace
'
,
"
Trace
"
),
level
:
LogLevel
.
Trace
,
description
:
this
.
getDescription
(
LogLevel
.
Trace
,
current
)
},
{
label
:
nls
.
localize
(
'
debug
'
,
"
Debug
"
),
level
:
LogLevel
.
Debug
,
description
:
this
.
getDescription
(
LogLevel
.
Debug
,
current
)
},
{
label
:
nls
.
localize
(
'
info
'
,
"
Info
"
),
level
:
LogLevel
.
Info
,
description
:
this
.
getDescription
(
LogLevel
.
Info
,
current
)
},
{
label
:
nls
.
localize
(
'
warn
'
,
"
Warning
"
),
level
:
LogLevel
.
Warning
,
description
:
this
.
getDescription
(
LogLevel
.
Warning
,
current
)
},
{
label
:
nls
.
localize
(
'
err
'
,
"
Error
"
),
level
:
LogLevel
.
Error
,
description
:
this
.
getDescription
(
LogLevel
.
Error
,
current
)
},
{
label
:
nls
.
localize
(
'
critical
'
,
"
Critical
"
),
level
:
LogLevel
.
Critical
,
description
:
this
.
getDescription
(
LogLevel
.
Critical
,
current
)
},
{
label
:
nls
.
localize
(
'
off
'
,
"
Off
"
),
level
:
LogLevel
.
Off
,
description
:
this
.
getDescription
(
LogLevel
.
Off
,
current
)
},
];
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 {
}
});
}
private
getDescription
(
level
:
LogLevel
,
current
:
LogLevel
):
string
{
if
(
DEFAULT_LOG_LEVEL
===
level
&&
current
===
level
)
{
return
nls
.
localize
(
'
default and current
'
,
"
Default & Current
"
);
}
if
(
DEFAULT_LOG_LEVEL
===
level
)
{
return
nls
.
localize
(
'
default
'
,
"
Default
"
);
}
if
(
current
===
level
)
{
return
nls
.
localize
(
'
current
'
,
"
Current
"
);
}
return
void
0
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录