17 lines
364 B
JavaScript
17 lines
364 B
JavaScript
|
'use strict'
|
||
|
|
||
|
const {netLog, NetLog} = process.atomBinding('net_log')
|
||
|
|
||
|
NetLog.prototype.stopLogging = function (callback) {
|
||
|
if (callback && typeof callback !== 'function') {
|
||
|
throw new Error('Invalid callback function')
|
||
|
}
|
||
|
|
||
|
const path = this.currentlyLoggingPath
|
||
|
this._stopLogging(() => {
|
||
|
if (callback) callback(path)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
module.exports = netLog
|