fix: switch to mojo proxy resolver (3-1-x) (#15813)
This commit is contained in:
parent
d5a6bb665b
commit
4abf55801f
65 changed files with 1838 additions and 1797 deletions
|
@ -1,21 +1,26 @@
|
|||
# netLog
|
||||
|
||||
> Logging network events.
|
||||
> Logging network events for a session.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
```javascript
|
||||
const {netLog} = require('electron')
|
||||
console.log('Start recording net-logs')
|
||||
netLog.startLogging('/path/to/net-log')
|
||||
// After some network events
|
||||
netLog.stopLogging(path => {
|
||||
console.log('Net-logs written to', path)
|
||||
const { netLog } = require('electron')
|
||||
|
||||
app.on('ready', function () {
|
||||
netLog.startLogging('/path/to/net-log')
|
||||
// After some network events
|
||||
netLog.stopLogging(path => {
|
||||
console.log('Net-logs written to', path)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
See [`--log-net-log`](chrome-command-line-switches.md#--log-net-logpath) to log network events throughout the app's lifecycle.
|
||||
|
||||
**Note:** All methods unless specified can only be used after the `ready` event
|
||||
of the `app` module gets emitted.
|
||||
|
||||
## Methods
|
||||
|
||||
### `netLog.startLogging(path)`
|
||||
|
|
|
@ -426,3 +426,20 @@ app.on('ready', function () {
|
|||
})
|
||||
})
|
||||
```
|
||||
|
||||
#### `ses.netLog`
|
||||
|
||||
A [NetLog](net-log.md) object for this session.
|
||||
|
||||
```javascript
|
||||
const { app, session } = require('electron')
|
||||
|
||||
app.on('ready', 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)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue