netLog
Registrar eventos de red para una sesión.
Proceso: principal
const { app, netLog } = require('electron')
app.whenReady().then(async () => {
await netLog.startLogging('/path/to/net-log')
// After some network events
const path = await netLog.stopLogging()
console.log('Net-logs written to', path)
})
See --log-net-log
to log network events throughout the app's lifecycle.
[!NOTE] All methods unless specified can only be used after the
ready
event of theapp
module gets emitted.
Métodos
netLog.startLogging(path[, options])
path
string - Ruta de archivo para guardar los registros de red.
Devuelve Promise<void>
- se resuelve cuando el net log ha comenzado a grabar.
Comienza la agravación de eventos de red en path
.
netLog.stopLogging()
Devuelve Promise<void>
- se resuelve cuando el net log se ha descargado en el disco.
Parar la grabación de eventos de red. Si no se llama, el registro de red automáticamente terminara cuando la aplicación se cierre.
Propiedades
netLog.currentlyLogging
SoloLectura
Una propiedad boolean
que indica si los registros de red están siendo grabados actualmente.