Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/extensions/default/DebugCommands/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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");
Expand Down Expand Up @@ -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());
}

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion src/loggerSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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){
Expand Down
1 change: 1 addition & 0 deletions src/nls/root/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion test/SpecRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading