mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: check ELECTRON_ENABLE_LOGGING via native implementation (#25623)
This commit is contained in:
@@ -461,8 +461,11 @@ const addReturnValueToEvent = (event: any) => {
|
||||
});
|
||||
};
|
||||
|
||||
const commandLine = process._linkedBinding('electron_common_command_line');
|
||||
const environment = process._linkedBinding('electron_common_environment');
|
||||
|
||||
const loggingEnabled = () => {
|
||||
return process.env.ELECTRON_ENABLE_LOGGING || app.commandLine.hasSwitch('enable-logging');
|
||||
return environment.hasVar('ELECTRON_ENABLE_LOGGING') || commandLine.hasSwitch('enable-logging');
|
||||
};
|
||||
|
||||
// Add JavaScript wrappers for WebContents class.
|
||||
|
||||
Reference in New Issue
Block a user