Skip to content

Commit

Permalink
chore: tsify net-log (#25670)
Browse files Browse the repository at this point in the history
* chore: tsify net-log

* comment

* gn

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
  • Loading branch information
trop[bot] and nornagon committed Sep 29, 2020
1 parent cdfbcb3 commit de0ddd5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 33 deletions.
2 changes: 1 addition & 1 deletion filenames.auto.gni
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ auto_filenames = {
"lib/browser/api/module-list.ts",
"lib/browser/api/native-image.ts",
"lib/browser/api/native-theme.ts",
"lib/browser/api/net-log.js",
"lib/browser/api/net-log.ts",
"lib/browser/api/net.ts",
"lib/browser/api/notification.js",
"lib/browser/api/power-monitor.ts",
Expand Down
32 changes: 0 additions & 32 deletions lib/browser/api/net-log.js

This file was deleted.

22 changes: 22 additions & 0 deletions lib/browser/api/net-log.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// TODO(deepak1556): Deprecate and remove standalone netLog module,
// it is now a property of session module.
import { app, session } from 'electron';

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;
}
};

0 comments on commit de0ddd5

Please sign in to comment.