refactor: check ELECTRON_ENABLE_LOGGING via native implementation (#25623)
This commit is contained in:
parent
fec1c0b68b
commit
b33f22601e
5 changed files with 59 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue