feat: promisify netLog.stopLogging (#16862)

This commit is contained in:
Milan Burda 2019-02-19 11:48:27 +01:00 committed by Alexey Kuzmin
parent 3b74837020
commit 7e7abc28f5
9 changed files with 78 additions and 35 deletions

View file

@ -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)
})
```