electron/lib/browser/api/net-log.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
720 B
TypeScript
Raw Normal View History

// TODO(deepak1556): Deprecate and remove standalone netLog module,
// it is now a property of session module.
import { app, session } from 'electron/main';
const startLogging: typeof session.defaultSession.netLog.startLogging = async (path, options) => {
if (!app.isReady()) return;
return session.defaultSession.netLog.startLogging(path, options);
};
const stopLogging: typeof session.defaultSession.netLog.stopLogging = async () => {
if (!app.isReady()) return;
return session.defaultSession.netLog.stopLogging();
};
export default {
startLogging,
stopLogging,
get currentlyLogging (): boolean {
if (!app.isReady()) return false;
return session.defaultSession.netLog.currentlyLogging;
}
};