diff --git a/src/extensions/default/DebugCommands/main.js b/src/extensions/default/DebugCommands/main.js index e35de35b42..e49f80fe26 100644 --- a/src/extensions/default/DebugCommands/main.js +++ b/src/extensions/default/DebugCommands/main.js @@ -80,6 +80,7 @@ define(function (require, exports, module) { DEBUG_ENABLE_PHNODE_INSPECTOR = "debug.enablePhNodeInspector", DEBUG_GET_PHNODE_INSPECTOR_URL = "debug.getPhNodeInspectorURL", DEBUG_LIVE_PREVIEW_LOGGING = "debug.livePreviewLogging", + DEBUG_GIT_EXTENSION_LOGGING = "debug.gitLogging", DEBUG_OPEN_VFS = "debug.openVFS", DEBUG_OPEN_EXTENSION_FOLDER = "debug.openExtensionFolders", DEBUG_OPEN_VIRTUAL_SERVER = "debug.openVirtualServer", @@ -88,7 +89,8 @@ define(function (require, exports, module) { DEBUG_DRAG_AND_DROP = "debug.dragAndDrop"; const LOG_TO_CONSOLE_KEY = logger.loggingOptions.LOCAL_STORAGE_KEYS.LOG_TO_CONSOLE_KEY, - LOG_LIVE_PREVIEW_KEY = logger.loggingOptions.LOCAL_STORAGE_KEYS.LOG_LIVE_PREVIEW; + LOG_LIVE_PREVIEW_KEY = logger.loggingOptions.LOCAL_STORAGE_KEYS.LOG_LIVE_PREVIEW, + LOG_GIT_KEY = logger.loggingOptions.LOCAL_STORAGE_KEYS.LOG_GIT; // define a preference to turn off opening preferences in split-view. var prefs = PreferencesManager.getExtensionPrefs("preferencesView"); @@ -697,7 +699,9 @@ define(function (require, exports, module) { CommandManager.get(DEBUG_ENABLE_LOGGING).setChecked(isLogging); CommandManager.get(DEBUG_LIVE_PREVIEW_LOGGING).setEnabled(isLogging); logger.loggingOptions.logLivePreview = window.isLoggingEnabled(LOG_LIVE_PREVIEW_KEY); + logger.loggingOptions.logGit = window.isLoggingEnabled(LOG_GIT_KEY); CommandManager.get(DEBUG_LIVE_PREVIEW_LOGGING).setChecked(logger.loggingOptions.logLivePreview); + CommandManager.get(DEBUG_GIT_EXTENSION_LOGGING).setChecked(logger.loggingOptions.logGit); CommandManager.get(DEBUG_ENABLE_PHNODE_INSPECTOR).setChecked(NodeConnector.isInspectEnabled()); } @@ -735,6 +739,11 @@ define(function (require, exports, module) { _updateLogToConsoleMenuItemChecked(); } + function _handleGitLogging() { + window.toggleLoggingKey(LOG_GIT_KEY); + _updateLogToConsoleMenuItemChecked(); + } + ExtensionManager.on("statusChange", function (id) { // Seems like an extension(s) got installed. // Need to recompute the default prefs. @@ -787,6 +796,7 @@ define(function (require, exports, module) { CommandManager.register(Strings.CMD_ENABLE_PHNODE_INSPECTOR, DEBUG_ENABLE_PHNODE_INSPECTOR, _handlePhNodeInspectEnable); CommandManager.register(Strings.CMD_GET_PHNODE_INSPECTOR_URL, DEBUG_GET_PHNODE_INSPECTOR_URL, _handleGetPhNodeInspectURL); CommandManager.register(Strings.CMD_ENABLE_LIVE_PREVIEW_LOGS, DEBUG_LIVE_PREVIEW_LOGGING, _handleLivePreviewLogging); + CommandManager.register(Strings.CMD_ENABLE_GIT_LOGS, DEBUG_GIT_EXTENSION_LOGGING, _handleGitLogging); CommandManager.register(Strings.CMD_OPEN_VFS, DEBUG_OPEN_VFS, _openVFS); CommandManager.register(Strings.CMD_OPEN_EXTENSIONS_FOLDER, DEBUG_OPEN_EXTENSION_FOLDER, _openExtensionsFolder); CommandManager.register(Strings.CMD_OPEN_VIRTUAL_SERVER, DEBUG_OPEN_VIRTUAL_SERVER, _openVirtualServer); @@ -823,6 +833,9 @@ define(function (require, exports, module) { hideWhenCommandDisabled: true }); diagnosticsSubmenu.addMenuItem(DEBUG_LIVE_PREVIEW_LOGGING); + if(Phoenix.isNativeApp) { + diagnosticsSubmenu.addMenuItem(DEBUG_GIT_EXTENSION_LOGGING); + } diagnosticsSubmenu.addMenuDivider(); diagnosticsSubmenu.addMenuItem(DEBUG_SHOW_PERF_DATA); diagnosticsSubmenu.addMenuItem(DEBUG_OPEN_VFS); diff --git a/src/loggerSetup.js b/src/loggerSetup.js index d1d1cef189..93180e4b30 100644 --- a/src/loggerSetup.js +++ b/src/loggerSetup.js @@ -98,9 +98,12 @@ LOCAL_STORAGE_KEYS: { // change these keys in devEnable.html too LOG_TO_CONSOLE_KEY: "logToConsole", - LOG_LIVE_PREVIEW: "logLivePreview" + LOG_LIVE_PREVIEW: "logLivePreview", + // these need not be dev enable for now + LOG_GIT: "logGitDebugMode" }, healthDataDisabled: false, + logGit: false, logLivePreview: false // logLivePreview will be setup below }, livePreview: { @@ -163,6 +166,8 @@ logger.loggingOptions.logLivePreview = window.isLoggingEnabled( logger.loggingOptions.LOCAL_STORAGE_KEYS.LOG_LIVE_PREVIEW); + logger.loggingOptions.logGit = window.isLoggingEnabled( + logger.loggingOptions.LOCAL_STORAGE_KEYS.LOG_GIT); function _shouldDiscardError(errors = []) { if(!window.Phoenix || !window.Phoenix.VFS){ diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 4619a5fa8f..6289789240 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -852,6 +852,7 @@ define({ "CMD_ENABLE_PHNODE_INSPECTOR": "Enable PhNode Inspector", "CMD_GET_PHNODE_INSPECTOR_URL": "How to Inspect PhNode", "CMD_ENABLE_LIVE_PREVIEW_LOGS": "Live Preview Logs", + "CMD_ENABLE_GIT_LOGS": "Git Verbose Logs", "CMD_OPEN_BRACKETS_SOURCE": "Open {APP_NAME} Source", "CREATING_LAUNCH_SCRIPT_TITLE": "{APP_NAME} Command Line Shortcut", diff --git a/test/SpecRunner.js b/test/SpecRunner.js index 271784d88c..0e0bf45447 100644 --- a/test/SpecRunner.js +++ b/test/SpecRunner.js @@ -59,7 +59,9 @@ window.logger = { loggingOptions: { LOCAL_STORAGE_KEYS: { - LOG_LIVE_PREVIEW: "logLivePreview" + LOG_LIVE_PREVIEW: "logLivePreview", + // these need not be dev enable for now + LOG_GIT: "logGitDebugMode" }, healthDataDisabled: false, logLivePreview: false // logLivePreview will be setup below