Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
3c00afcb
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3c00afcb
编写于
5月 22, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#72906 use async spdlog service
上级
56f7e935
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
21 addition
and
14 deletion
+21
-14
src/vs/code/electron-browser/issue/issueReporterMain.ts
src/vs/code/electron-browser/issue/issueReporterMain.ts
+2
-2
src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
.../code/electron-browser/sharedProcess/sharedProcessMain.ts
+3
-3
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+1
-1
src/vs/code/node/cliProcessMain.ts
src/vs/code/node/cliProcessMain.ts
+2
-2
src/vs/platform/log/node/spdlogService.ts
src/vs/platform/log/node/spdlogService.ts
+9
-2
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+2
-2
src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts
...nch/services/extensions/node/extensionHostProcessSetup.ts
+2
-2
未找到文件。
src/vs/code/electron-browser/issue/issueReporterMain.ts
浏览文件 @
3c00afcb
...
...
@@ -33,7 +33,7 @@ import { EnvironmentService } from 'vs/platform/environment/node/environmentServ
import
{
IssueReporterModel
,
IssueReporterData
as
IssueReporterModelData
}
from
'
vs/code/electron-browser/issue/issueReporterModel
'
;
import
{
IssueReporterData
,
IssueReporterStyles
,
IssueType
,
ISettingsSearchIssueReporterData
,
IssueReporterFeatures
,
IssueReporterExtensionData
}
from
'
vs/platform/issue/common/issue
'
;
import
BaseHtml
from
'
vs/code/electron-browser/issue/issueReporterPage
'
;
import
{
createSpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
create
Buffer
SpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
LogLevelSetterChannelClient
,
FollowerLogService
}
from
'
vs/platform/log/node/logIpc
'
;
import
{
ILogService
,
getLogLevel
}
from
'
vs/platform/log/common/log
'
;
import
{
OcticonLabel
}
from
'
vs/base/browser/ui/octiconLabel/octiconLabel
'
;
...
...
@@ -300,7 +300,7 @@ export class IssueReporter extends Disposable {
serviceCollection
.
set
(
IWindowsService
,
new
WindowsService
(
mainProcessService
));
this
.
environmentService
=
new
EnvironmentService
(
configuration
,
configuration
.
execPath
);
const
logService
=
createSpdLogService
(
`issuereporter
${
configuration
.
windowId
}
`
,
getLogLevel
(
this
.
environmentService
),
this
.
environmentService
.
logsPath
);
const
logService
=
create
Buffer
SpdLogService
(
`issuereporter
${
configuration
.
windowId
}
`
,
getLogLevel
(
this
.
environmentService
),
this
.
environmentService
.
logsPath
);
const
logLevelClient
=
new
LogLevelSetterChannelClient
(
mainProcessService
.
getChannel
(
'
loglevel
'
));
this
.
logService
=
new
FollowerLogService
(
logLevelClient
,
logService
);
...
...
src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
浏览文件 @
3c00afcb
...
...
@@ -30,7 +30,7 @@ import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppen
import
{
IWindowsService
,
ActiveWindowManager
}
from
'
vs/platform/windows/common/windows
'
;
import
{
WindowsService
}
from
'
vs/platform/windows/electron-browser/windowsService
'
;
import
{
ipcRenderer
}
from
'
electron
'
;
import
{
createSpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
create
Buffer
SpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
ILogService
,
LogLevel
}
from
'
vs/platform/log/common/log
'
;
import
{
LogLevelSetterChannelClient
,
FollowerLogService
}
from
'
vs/platform/log/node/logIpc
'
;
import
{
LocalizationsService
}
from
'
vs/platform/localizations/node/localizations
'
;
...
...
@@ -94,7 +94,7 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
const
mainRouter
=
new
StaticRouter
(
ctx
=>
ctx
===
'
main
'
);
const
logLevelClient
=
new
LogLevelSetterChannelClient
(
server
.
getChannel
(
'
loglevel
'
,
mainRouter
));
const
logService
=
new
FollowerLogService
(
logLevelClient
,
createSpdLogService
(
'
sharedprocess
'
,
initData
.
logLevel
,
environmentService
.
logsPath
));
const
logService
=
new
FollowerLogService
(
logLevelClient
,
create
Buffer
SpdLogService
(
'
sharedprocess
'
,
initData
.
logLevel
,
environmentService
.
logsPath
));
disposables
.
push
(
logService
);
logService
.
info
(
'
main
'
,
JSON
.
stringify
(
configuration
));
...
...
@@ -122,7 +122,7 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
const
services
=
new
ServiceCollection
();
const
environmentService
=
accessor
.
get
(
IEnvironmentService
);
const
{
appRoot
,
extensionsPath
,
extensionDevelopmentLocationURI
:
extensionDevelopmentLocationURI
,
isBuilt
,
installSourcePath
}
=
environmentService
;
const
telemetryLogService
=
new
FollowerLogService
(
logLevelClient
,
createSpdLogService
(
'
telemetry
'
,
initData
.
logLevel
,
environmentService
.
logsPath
));
const
telemetryLogService
=
new
FollowerLogService
(
logLevelClient
,
create
Buffer
SpdLogService
(
'
telemetry
'
,
initData
.
logLevel
,
environmentService
.
logsPath
));
telemetryLogService
.
info
(
'
The below are logs for every telemetry event sent from VS Code once the log level is set to trace.
'
);
telemetryLogService
.
info
(
'
===========================================================
'
);
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
3c00afcb
...
...
@@ -288,7 +288,7 @@ function startup(args: ParsedArgs): void {
return
Promise
.
reject
(
error
);
})
.
then
(
mainIpcServer
=>
{
bufferLogService
.
logger
=
createSpdLogService
(
'
main
'
,
bufferLogService
.
getLevel
(),
environmentService
.
logsPath
);
createSpdLogService
(
'
main
'
,
bufferLogService
.
getLevel
(),
environmentService
.
logsPath
).
then
(
logger
=>
bufferLogService
.
logger
=
logger
);
return
instantiationService
.
createInstance
(
CodeApplication
,
mainIpcServer
,
instanceEnvironment
).
startup
();
});
...
...
src/vs/code/node/cliProcessMain.ts
浏览文件 @
3c00afcb
...
...
@@ -31,7 +31,7 @@ import { mkdirp, writeFile } from 'vs/base/node/pfs';
import
{
getBaseLabel
}
from
'
vs/base/common/labels
'
;
import
{
IStateService
}
from
'
vs/platform/state/common/state
'
;
import
{
StateService
}
from
'
vs/platform/state/node/stateService
'
;
import
{
createSpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
create
Buffer
SpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
ILogService
,
getLogLevel
}
from
'
vs/platform/log/common/log
'
;
import
{
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
import
{
areSameExtensions
,
adoptToGalleryExtensionId
,
getGalleryExtensionId
}
from
'
vs/platform/extensionManagement/common/extensionManagementUtil
'
;
...
...
@@ -291,7 +291,7 @@ export function main(argv: ParsedArgs): Promise<void> {
const
services
=
new
ServiceCollection
();
const
environmentService
=
new
EnvironmentService
(
argv
,
process
.
execPath
);
const
logService
=
createSpdLogService
(
'
cli
'
,
getLogLevel
(
environmentService
),
environmentService
.
logsPath
);
const
logService
=
create
Buffer
SpdLogService
(
'
cli
'
,
getLogLevel
(
environmentService
),
environmentService
.
logsPath
);
process
.
once
(
'
exit
'
,
()
=>
logService
.
dispose
());
logService
.
info
(
'
main
'
,
argv
);
...
...
src/vs/platform/log/node/spdlogService.ts
浏览文件 @
3c00afcb
...
...
@@ -6,14 +6,15 @@
import
*
as
path
from
'
vs/base/common/path
'
;
import
{
ILogService
,
LogLevel
,
NullLogService
,
AbstractLogService
}
from
'
vs/platform/log/common/log
'
;
import
*
as
spdlog
from
'
spdlog
'
;
import
{
BufferLogService
}
from
'
vs/platform/log/common/bufferLog
'
;
export
function
createSpdLogService
(
processName
:
string
,
logLevel
:
LogLevel
,
logsFolder
:
string
):
ILogService
{
export
async
function
createSpdLogService
(
processName
:
string
,
logLevel
:
LogLevel
,
logsFolder
:
string
):
Promise
<
ILogService
>
{
// Do not crash if spdlog cannot be loaded
try
{
const
_spdlog
:
typeof
spdlog
=
require
.
__$__nodeRequire
(
'
spdlog
'
);
_spdlog
.
setAsyncMode
(
8192
,
500
);
const
logfilePath
=
path
.
join
(
logsFolder
,
`
${
processName
}
.log`
);
const
logger
=
new
_spdlog
.
RotatingLogger
(
processName
,
logfilePath
,
1024
*
1024
*
5
,
6
);
const
logger
=
await
_spdlog
.
createRotatingLoggerAsync
(
processName
,
logfilePath
,
1024
*
1024
*
5
,
6
);
logger
.
setLevel
(
0
);
return
new
SpdLogService
(
logger
,
logLevel
);
...
...
@@ -28,6 +29,12 @@ export function createRotatingLogger(name: string, filename: string, filesize: n
return
_spdlog
.
createRotatingLogger
(
name
,
filename
,
filesize
,
filecount
);
}
export
function
createBufferSpdLogService
(
processName
:
string
,
logLevel
:
LogLevel
,
logsFolder
:
string
):
ILogService
{
const
bufferLogService
=
new
BufferLogService
();
createSpdLogService
(
processName
,
logLevel
,
logsFolder
).
then
(
logger
=>
bufferLogService
.
logger
=
logger
);
return
bufferLogService
;
}
class
SpdLogService
extends
AbstractLogService
implements
ILogService
{
_serviceBrand
:
any
;
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
3c00afcb
...
...
@@ -23,7 +23,7 @@ import { KeyboardMapperFactory } from 'vs/workbench/services/keybinding/electron
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
import
{
webFrame
}
from
'
electron
'
;
import
{
ISingleFolderWorkspaceIdentifier
,
IWorkspaceInitializationPayload
,
ISingleFolderWorkspaceInitializationPayload
,
reviveWorkspaceIdentifier
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
createSpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
create
Buffer
SpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
ConsoleLogService
,
MultiplexLogService
,
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
StorageService
}
from
'
vs/platform/storage/node/storageService
'
;
import
{
LogLevelSetterChannelClient
,
FollowerLogService
}
from
'
vs/platform/log/node/logIpc
'
;
...
...
@@ -322,7 +322,7 @@ class CodeRendererMain extends Disposable {
}
private
createLogService
(
mainProcessService
:
IMainProcessService
,
environmentService
:
IWorkbenchEnvironmentService
):
ILogService
{
const
spdlogService
=
createSpdLogService
(
`renderer
${
this
.
configuration
.
windowId
}
`
,
this
.
configuration
.
logLevel
,
environmentService
.
logsPath
);
const
spdlogService
=
create
Buffer
SpdLogService
(
`renderer
${
this
.
configuration
.
windowId
}
`
,
this
.
configuration
.
logLevel
,
environmentService
.
logsPath
);
const
consoleLogService
=
new
ConsoleLogService
(
this
.
configuration
.
logLevel
);
const
logService
=
new
MultiplexLogService
([
consoleLogService
,
spdlogService
]);
const
logLevelClient
=
new
LogLevelSetterChannelClient
(
mainProcessService
.
getChannel
(
'
loglevel
'
));
...
...
src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts
浏览文件 @
3c00afcb
...
...
@@ -15,7 +15,7 @@ import { IInitData, MainThreadConsoleShape } from 'vs/workbench/api/common/extHo
import
{
MessageType
,
createMessageOfType
,
isMessageOfType
,
IExtHostSocketMessage
,
IExtHostReadyMessage
}
from
'
vs/workbench/services/extensions/common/extensionHostProtocol
'
;
import
{
ExtensionHostMain
,
IExitFn
,
ILogServiceFn
}
from
'
vs/workbench/services/extensions/node/extensionHostMain
'
;
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
createSpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
create
Buffer
SpdLogService
}
from
'
vs/platform/log/node/spdlogService
'
;
import
{
ExtensionHostLogFileName
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
ISchemeTransformer
}
from
'
vs/workbench/api/common/extHostLanguageFeatures
'
;
import
{
IURITransformer
}
from
'
vs/base/common/uriIpc
'
;
...
...
@@ -72,7 +72,7 @@ function patchPatchedConsole(mainThreadConsole: MainThreadConsoleShape): void {
};
}
const
createLogService
:
ILogServiceFn
=
initData
=>
createSpdLogService
(
ExtensionHostLogFileName
,
initData
.
logLevel
,
initData
.
logsLocation
.
fsPath
);
const
createLogService
:
ILogServiceFn
=
initData
=>
create
Buffer
SpdLogService
(
ExtensionHostLogFileName
,
initData
.
logLevel
,
initData
.
logsLocation
.
fsPath
);
interface
IRendererConnection
{
protocol
:
IMessagePassingProtocol
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录