feat: promisify netLog.stopLogging (#16862)
This commit is contained in:
parent
3b74837020
commit
7e7abc28f5
9 changed files with 78 additions and 35 deletions
|
@ -462,12 +462,11 @@ A [NetLog](net-log.md) object for this session.
|
|||
```javascript
|
||||
const { app, session } = require('electron')
|
||||
|
||||
app.on('ready', function () {
|
||||
app.on('ready', async function () {
|
||||
const netLog = session.fromPartition('some-partition').netLog
|
||||
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)
|
||||
})
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue