mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-06 05:56:09 -05:00
set log level action
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
"node-pty": "0.7.3",
|
||||
"nsfw": "1.0.16",
|
||||
"semver": "4.3.6",
|
||||
"spdlog": "0.2.0",
|
||||
"spdlog": "0.2.1",
|
||||
"v8-inspect-profiler": "^0.0.6",
|
||||
"vscode-chokidar": "1.6.2",
|
||||
"vscode-debugprotocol": "1.25.0-pre.0",
|
||||
@@ -127,4 +127,4 @@
|
||||
"windows-mutex": "^0.2.0",
|
||||
"windows-process-tree": "0.1.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
1
src/typings/spdlog.d.ts
vendored
1
src/typings/spdlog.d.ts
vendored
@@ -7,6 +7,7 @@ declare module 'spdlog' {
|
||||
|
||||
export const version: string;
|
||||
export function setAsyncMode(bufferSize: number, flushInterval: number);
|
||||
export function setLevel(level: number);
|
||||
|
||||
export enum LogLevel {
|
||||
CRITICAL,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import 'vs/css!./media/actions';
|
||||
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { setLevel } from 'spdlog';
|
||||
import * as collections from 'vs/base/common/collections';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
@@ -1676,7 +1677,7 @@ export class ConfigureLocaleAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenLogsFlderAction extends Action {
|
||||
export class OpenLogsFolderAction extends Action {
|
||||
|
||||
static ID = 'workbench.action.openLogsFolder';
|
||||
static LABEL = nls.localize('openLogsFolder', "Open Logs Folder");
|
||||
@@ -1721,4 +1722,34 @@ export class ShowLogsAction extends Action {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class SetLogLevelAction extends Action {
|
||||
|
||||
static ID = 'workbench.action.setLogLevel';
|
||||
static LABEL = nls.localize('setLogLevel', "Set Log Level");
|
||||
|
||||
constructor(id: string, label: string,
|
||||
@IQuickOpenService private quickOpenService: IQuickOpenService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public run(): TPromise<void> {
|
||||
const entries: IPickOpenEntry[] = [
|
||||
{ id: '0', label: nls.localize('verbose', "Verbose") },
|
||||
{ id: '1', label: nls.localize('debug', "Debug") },
|
||||
{ id: '2', label: nls.localize('info', "Info") },
|
||||
{ id: '3', label: nls.localize('warn', "Warning") },
|
||||
{ id: '4', label: nls.localize('err', "Error") },
|
||||
{ id: '5', label: nls.localize('critical', "Critical") },
|
||||
{ id: '6', label: nls.localize('off', "Off") }
|
||||
];
|
||||
return this.quickOpenService.pick(entries, { placeHolder: nls.localize('selectProcess', "Select process") })
|
||||
.then(entry => {
|
||||
if (entry) {
|
||||
setLevel(parseInt(entry.id));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'v
|
||||
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
|
||||
import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform';
|
||||
import { CloseEditorAction, KeybindingsReferenceAction, OpenDocumentationUrlAction, OpenIntroductoryVideosUrlAction, OpenTipsAndTricksUrlAction, ReportIssueAction, ReportPerformanceIssueAction, ZoomResetAction, ZoomOutAction, ZoomInAction, ToggleFullScreenAction, ToggleMenuBarAction, CloseWorkspaceAction, CloseCurrentWindowAction, SwitchWindow, NewWindowAction, CloseMessagesAction, NavigateUpAction, NavigateDownAction, NavigateLeftAction, NavigateRightAction, IncreaseViewSizeAction, DecreaseViewSizeAction, ShowStartupPerformance, ToggleSharedProcessAction, QuickSwitchWindow, QuickOpenRecentAction, inRecentFilesPickerContextKey, ConfigureLocaleAction, ShowLogsAction, OpenLogsFlderAction } from 'vs/workbench/electron-browser/actions';
|
||||
import { CloseEditorAction, KeybindingsReferenceAction, OpenDocumentationUrlAction, OpenIntroductoryVideosUrlAction, OpenTipsAndTricksUrlAction, ReportIssueAction, ReportPerformanceIssueAction, ZoomResetAction, ZoomOutAction, ZoomInAction, ToggleFullScreenAction, ToggleMenuBarAction, CloseWorkspaceAction, CloseCurrentWindowAction, SwitchWindow, NewWindowAction, CloseMessagesAction, NavigateUpAction, NavigateDownAction, NavigateLeftAction, NavigateRightAction, IncreaseViewSizeAction, DecreaseViewSizeAction, ShowStartupPerformance, ToggleSharedProcessAction, QuickSwitchWindow, QuickOpenRecentAction, inRecentFilesPickerContextKey, ConfigureLocaleAction, ShowLogsAction, OpenLogsFolderAction, SetLogLevelAction } from 'vs/workbench/electron-browser/actions';
|
||||
import { MessagesVisibleContext } from 'vs/workbench/electron-browser/workbench';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import { registerCommands } from 'vs/workbench/electron-browser/commands';
|
||||
@@ -37,7 +37,8 @@ workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(CloseC
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(SwitchWindow, SwitchWindow.ID, SwitchWindow.LABEL, { primary: null, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_W } }), 'Switch Window...');
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(QuickSwitchWindow, QuickSwitchWindow.ID, QuickSwitchWindow.LABEL), 'Quick Switch Window...');
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ShowLogsAction, ShowLogsAction.ID, ShowLogsAction.LABEL), 'Show Logs...');
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenLogsFlderAction, OpenLogsFlderAction.ID, OpenLogsFlderAction.LABEL), 'Open Log Folder');
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenLogsFolderAction, OpenLogsFolderAction.ID, OpenLogsFolderAction.LABEL), 'Open Log Folder');
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(SetLogLevelAction, SetLogLevelAction.ID, SetLogLevelAction.LABEL), 'Set Log Level');
|
||||
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenRecentAction, QuickOpenRecentAction.ID, QuickOpenRecentAction.LABEL), 'File: Quick Open Recent...', fileCategory);
|
||||
|
||||
|
||||
@@ -5038,9 +5038,9 @@ sparkles@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3"
|
||||
|
||||
spdlog@0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/spdlog/-/spdlog-0.2.0.tgz#45ca84aa37a8c84cdbd1f52206890e1db0639636"
|
||||
spdlog@0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/spdlog/-/spdlog-0.2.1.tgz#1a9de952ccffe9b9227dd20306aca7e428621fa1"
|
||||
dependencies:
|
||||
bindings "^1.3.0"
|
||||
mkdirp "^0.5.1"
|
||||
|
||||
Reference in New Issue
Block a user