mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: promisify netLog.stopLogging (#16862)
This commit is contained in:
committed by
Alexey Kuzmin
parent
3b74837020
commit
7e7abc28f5
@@ -7,12 +7,11 @@ Process: [Main](../glossary.md#main-process)
|
||||
```javascript
|
||||
const { netLog } = require('electron')
|
||||
|
||||
app.on('ready', function () {
|
||||
app.on('ready', async function () {
|
||||
netLog.startLogging('/path/to/net-log')
|
||||
// After some network events
|
||||
netLog.stopLogging(path => {
|
||||
console.log('Net-logs written to', path)
|
||||
})
|
||||
const path = await netLog.stopLogging()
|
||||
console.log('Net-logs written to', path)
|
||||
})
|
||||
```
|
||||
|
||||
@@ -36,6 +35,14 @@ Starts recording network events to `path`.
|
||||
|
||||
Stops recording network events. If not called, net logging will automatically end when app quits.
|
||||
|
||||
**[Deprecated Soon](promisification.md)**
|
||||
|
||||
### `netLog.stopLogging()`
|
||||
|
||||
Returns `Promise<String>` - resolves with a file path to which network logs were recorded.
|
||||
|
||||
Stops recording network events. If not called, net logging will automatically end when app quits.
|
||||
|
||||
## Properties
|
||||
|
||||
### `netLog.currentlyLogging`
|
||||
|
||||
Reference in New Issue
Block a user