Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
279c4d04
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,发现更多精彩内容 >>
提交
279c4d04
编写于
1月 26, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Forward stdin for loguploader
Fixes #42055
上级
5621d993
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
16 deletion
+21
-16
src/vs/code/electron-main/logUploader.ts
src/vs/code/electron-main/logUploader.ts
+16
-12
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+1
-2
src/vs/code/node/cli.ts
src/vs/code/node/cli.ts
+4
-2
未找到文件。
src/vs/code/electron-main/logUploader.ts
浏览文件 @
279c4d04
...
...
@@ -9,6 +9,7 @@ import * as os from 'os';
import
*
as
cp
from
'
child_process
'
;
import
*
as
fs
from
'
fs
'
;
import
*
as
path
from
'
path
'
;
import
*
as
readline
from
'
readline
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
ILaunchChannel
}
from
'
vs/code/electron-main/launch
'
;
...
...
@@ -16,8 +17,6 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
product
from
'
vs/platform/node/product
'
;
import
{
IRequestService
}
from
'
vs/platform/request/node/request
'
;
import
{
IRequestContext
}
from
'
vs/base/node/request
'
;
import
{
IChoiceService
}
from
'
vs/platform/message/common/message
'
;
import
Severity
from
'
vs/base/common/severity
'
;
interface
PostResult
{
readonly
blob_id
:
string
;
...
...
@@ -36,8 +35,7 @@ class Endpoint {
export
async
function
uploadLogs
(
channel
:
ILaunchChannel
,
requestService
:
IRequestService
,
choiceService
:
IChoiceService
requestService
:
IRequestService
):
TPromise
<
any
>
{
const
endpoint
=
Endpoint
.
getFromProduct
();
if
(
!
endpoint
)
{
...
...
@@ -47,7 +45,7 @@ export async function uploadLogs(
const
logsPath
=
await
channel
.
call
(
'
get-logs-path
'
,
null
);
if
(
await
promptUserToConfirmLogUpload
(
logsPath
,
choiceService
))
{
if
(
await
promptUserToConfirmLogUpload
(
logsPath
))
{
console
.
log
(
localize
(
'
beginUploading
'
,
'
Uploading...
'
));
const
outZip
=
await
zipLogs
(
logsPath
);
const
result
=
await
postLogs
(
endpoint
,
outZip
,
requestService
);
...
...
@@ -59,17 +57,23 @@ export async function uploadLogs(
async
function
promptUserToConfirmLogUpload
(
logsPath
:
string
,
choiceService
:
IChoiceService
):
Promise
<
boolean
>
{
const
message
=
localize
(
'
logUploadPromptHeader
'
,
'
Upload session logs to secure endpoint?
'
)
+
'
\n\n
'
+
localize
(
'
logUploadPromptBody
'
,
'
Please review your log files here:
\'
{0}
\'
'
,
logsPath
)
+
'
\n\n
'
+
localize
(
'
logUploadPromptBodyDetails
'
,
'
Logs may contain personal information such as full paths and file contents.
'
)
+
'
\n\n
'
;
const
choice
=
await
choiceService
.
choose
(
Severity
.
Info
,
message
,
[
localize
(
'
logUploadPromptKey
'
,
'
I have reviewed my logs. Proceed with upload...
'
),
localize
(
'
logUploadPromptCancel
'
,
'
Cancel
'
),
],
1
);
return
choice
===
0
;
+
'
\n\n
'
+
localize
(
'
logUploadPromptKey
'
,
'
I have reviewed my logs (enter
\'
y
\'
to confirm upload)
'
);
const
rl
=
readline
.
createInterface
({
input
:
process
.
stdin
,
output
:
process
.
stdout
});
return
new
TPromise
<
boolean
>
(
resolve
=>
rl
.
question
(
message
,
(
answer
:
string
)
=>
{
rl
.
close
();
resolve
(
answer
&&
answer
.
trim
()[
0
].
toLowerCase
()
===
'
y
'
);
}));
}
async
function
postLogs
(
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
279c4d04
...
...
@@ -109,7 +109,6 @@ function setupIPC(accessor: ServicesAccessor): TPromise<Server> {
const
logService
=
accessor
.
get
(
ILogService
);
const
environmentService
=
accessor
.
get
(
IEnvironmentService
);
const
requestService
=
accessor
.
get
(
IRequestService
);
const
choiceService
=
accessor
.
get
(
IChoiceService
);
function
allowSetForegroundWindow
(
service
:
LaunchChannelClient
):
TPromise
<
void
>
{
let
promise
=
TPromise
.
wrap
<
void
>
(
void
0
);
...
...
@@ -203,7 +202,7 @@ function setupIPC(accessor: ServicesAccessor): TPromise<Server> {
// Log uploader
if
(
environmentService
.
args
[
'
upload-logs
'
])
{
return
uploadLogs
(
channel
,
requestService
,
choiceService
)
return
uploadLogs
(
channel
,
requestService
)
.
then
(()
=>
TPromise
.
wrapError
(
new
ExpectedError
()));
}
...
...
src/vs/code/node/cli.ts
浏览文件 @
279c4d04
...
...
@@ -123,7 +123,7 @@ export async function main(argv: string[]): TPromise<any> {
const
processCallbacks
:
((
child
:
ChildProcess
)
=>
Thenable
<
any
>
)[]
=
[];
const
verbose
=
args
.
verbose
||
args
.
status
;
const
verbose
=
args
.
verbose
||
args
.
status
||
args
[
'
upload-logs
'
]
;
if
(
verbose
)
{
env
[
'
ELECTRON_ENABLE_LOGGING
'
]
=
'
1
'
;
...
...
@@ -311,7 +311,9 @@ export async function main(argv: string[]): TPromise<any> {
env
};
if
(
!
verbose
)
{
if
(
args
[
'
upload-logs
'
])
{
options
[
'
stdio
'
]
=
[
process
.
stdin
,
'
pipe
'
,
'
pipe
'
];
}
else
if
(
!
verbose
)
{
options
[
'
stdio
'
]
=
'
ignore
'
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录