Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return path from netLog.stopLogging #21988

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/browser/api/session.js
Expand Up @@ -36,8 +36,9 @@ NetLog.prototype.startLogging = function (path, ...args) {

const _originalStopLogging = NetLog.prototype.stopLogging
NetLog.prototype.stopLogging = function () {
const logPath = this._currentlyLoggingPath
this._currentlyLoggingPath = null
return _originalStopLogging.call(this)
return _originalStopLogging.call(this).then(() => logPath)
}

const currentlyLoggingPathDeprecated = deprecate.warnOnce('currentlyLoggingPath')
Expand Down
3 changes: 2 additions & 1 deletion spec-main/api-net-log-spec.js
Expand Up @@ -70,7 +70,8 @@ describe('netLog module', () => {

expect(testNetLog().currentlyLoggingPath).to.equal(dumpFileDynamic)

await testNetLog().stopLogging()
const path = await testNetLog().stopLogging()
expect(path).to.equal(dumpFileDynamic)

expect(fs.existsSync(dumpFileDynamic)).to.be.true()
})
Expand Down