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
@@ -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)
|
||||
})
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user