Electron中文文档

新手 685983304  中级 642625556 高级 602866851 Q群区别? 征集友情链接公告

推荐版:3.0.10   测试版:4.0.0-beta.8   极客版:4.0.0-nightly.20181010  

netLog

Logging network events.

进程:主进程

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

See --log-net-log to log network events throughout the app's lifecycle.

方法

netLog.startLogging(path)

  • path String - File path to record network logs.

Starts recording network events to path.

netLog.stopLogging([callback])

  • callback Function (可选)
    • path String - File path to which network logs were recorded.

Stops recording network events. If not called, net logging will automatically end when app quits.

属性

netLog.currentlyLogging

A Boolean property that indicates whether network logs are recorded.

netLog.currentlyLoggingPath

A String property that returns the path to the current log file.



相关npm包集合




相关站点资源





官方指南

常见问题 (FAQ)

指南和教程

详细教程

API 参考

自定义 DOM 元素:

主进程可用的模块:

渲染进程(网页)可用的模块:

两种进程都可用的模块:

开发

  • electron 如何禁用页面缩放事件?
  • electron 如何加载 chrome 的 crx 扩展插件?
  • JS开发者社区

    和大家在一起

    新手/1元新手 685983304 
    中级/5元 中级 642625556
    高级/50元 高级 602866851