Skip to content

Commit d40e247

Browse files
committed
added env var
1 parent d3ec912 commit d40e247

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/service.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,10 @@ export default class LambdaRestService {
244244
log.info(`Update job with sessionId ${this._browser.sessionId}, ${status}`);
245245

246246
// Print session URL for single remote browser
247-
const sessionURL = this.getSessionURL(this._browser.sessionId, this._config.product);
248-
log.info(`Session URL: ${sessionURL}`);
247+
if(process.env.LOG_SESSION_URL === "true") {
248+
const sessionURL = this.getSessionURL(this._browser.sessionId, this._config.product);
249+
log.info(`Session URL: ${sessionURL}`);
250+
}
249251

250252
return this._update({ sessionId: this._browser.sessionId, failures: result });
251253
}
@@ -254,8 +256,10 @@ export default class LambdaRestService {
254256
log.info(`Update multiremote job for browser '${browserName}' and sessionId ${this._browser[browserName].sessionId}, ${status}`);
255257

256258
// Print session URL for each remote browser
257-
const sessionURL = this.getSessionURL(this._browser[browserName].sessionId, this._config.product);
258-
log.info(`Session URL for ${browserName}: ${sessionURL}`);
259+
if(process.env.LOG_SESSION_URL === "true") {
260+
const sessionURL = this.getSessionURL(this._browser[browserName].sessionId, this._config.product);
261+
log.info(`Session URL for ${browserName}: ${sessionURL}`);
262+
}
259263

260264
return this._update({ sessionId: this._browser[browserName].sessionId, failures: failures, calledOnReload: false, browserName: browserName });
261265
}));
@@ -272,8 +276,10 @@ export default class LambdaRestService {
272276
log.info(`Update (reloaded) job with sessionId ${oldSessionId}, ${status}`);
273277

274278
// Print session URL for single remote browser
275-
const sessionURL = this.getSessionURL(this._browser.sessionId, this._config.product);
276-
log.info(`Session URL: ${sessionURL}`);
279+
if(process.env.LOG_SESSION_URL === "true") {
280+
const sessionURL = this.getSessionURL(this._browser.sessionId, this._config.product);
281+
log.info(`Session URL: ${sessionURL}`);
282+
}
277283

278284
await this._update({ sessionId: oldSessionId, fullTitle: this._currentTestTitle, status: status, calledOnReload: true });
279285

@@ -282,8 +288,10 @@ export default class LambdaRestService {
282288
log.info(`Update (reloaded) multiremote job for browser '${browserName}' and sessionId ${oldSessionId}, ${status}`);
283289

284290
// Print session URL for each remote browser
285-
const sessionURL = this.getSessionURL(this._browser[browserName].sessionId, this._config.product);
286-
log.info(`Session URL for ${browserName}: ${sessionURL}`);
291+
if(process.env.LOG_SESSION_URL === "true") {
292+
const sessionURL = this.getSessionURL(this._browser[browserName].sessionId, this._config.product);
293+
log.info(`Session URL for ${browserName}: ${sessionURL}`);
294+
}
287295

288296
await this._update({ sessionId : oldSessionId, failures:this._failures, calledOnReload: true, browserName: browserName });
289297
}

0 commit comments

Comments
 (0)