Skip to content
This repository was archived by the owner on Oct 27, 2021. It is now read-only.

Commit e8094b5

Browse files
author
Ian Walter
committed
Fixing other logLevel instances
1 parent d2821a2 commit e8094b5

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

cli.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ async function run () {
88
const config = cli({
99
name: 'bff',
1010
options: {
11-
logLevel: {
11+
log: {
1212
alias: 'l',
13-
default: 'info'
13+
description: "Specifies bff-webdriver's print (logging) configuration",
14+
default: { level: 'info' }
1415
}
1516
}
1617
})
17-
const print = new Print({ level: config.logLevel })
18+
const print = new Print(config.log)
1819
const { _: [command] } = config
1920

2021
try {

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const shouldUseBsl = ({ browserstackLocal, capabilities: cap }) =>
1212
module.exports = {
1313
webdriverVersion,
1414
async before (context) {
15-
print = new Print({ level: context.log.level })
15+
print = new Print(context.log)
1616
try {
1717
// Set the WebDriver version if not already configured.
1818
context.webdriver.version = context.webdriver.version || webdriverVersion
@@ -54,7 +54,7 @@ module.exports = {
5454
}
5555
},
5656
registration (file, context) {
57-
print = new Print({ level: context.logLevel })
57+
print = new Print(context.log)
5858
try {
5959
// Extract the WebDriver capabilities from the test configuration.
6060
const capabilities = Array.isArray(context.webdriver.capabilities)
@@ -89,7 +89,7 @@ module.exports = {
8989
}
9090
},
9191
async beforeEach (file, context) {
92-
print = new Print({ level: context.logLevel })
92+
print = new Print(context.log)
9393

9494
try {
9595
print.debug('Adding WebDriver integrations')
@@ -120,7 +120,7 @@ module.exports = {
120120
context.testContext.browser = await remote({
121121
path: '/wd/hub',
122122
...context.webdriver,
123-
logLevel: context.webdriver.logLevel || context.logLevel,
123+
logLevel: context.webdriver.logLevel || context.log.level,
124124
capabilities: context.testContext.capability
125125
})
126126

integrations/appium.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { Print } = require('@ianwalter/print')
55
module.exports = class AppiumIntegration {
66
constructor (context) {
77
// Set up a print instance on the integration instance so it can be reused.
8-
this.print = new Print({ level: context.logLevel })
8+
this.print = new Print(context.log)
99
this.print.debug('Appium integration enabled')
1010

1111
// Define the global capability options.

integrations/browserstack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { Print } = require('@ianwalter/print')
55
module.exports = class BrowserStackIntegration {
66
constructor (context) {
77
// Set up a print instance on the integration instance so it can be reused.
8-
this.print = new Print({ level: context.logLevel })
8+
this.print = new Print(context.log)
99
this.print.debug('BrowserStack integration enabled')
1010

1111
// Make BrowserStack the WebDriver backend if not already configured.

integrations/zalenium.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { Print } = require('@ianwalter/print')
33
module.exports = class ZaleniumIntegration {
44
constructor (context) {
55
// Set up a print instance on the integration instance so it can be reused.
6-
this.print = new Print({ level: context.logLevel })
6+
this.print = new Print(context.log)
77
this.print.debug('Zalenium integration enabled')
88
}
99

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
"@ianwalter/url": "^2.0.0"
5959
},
6060
"bff": {
61-
"logLevel": "debug",
61+
"log": {
62+
"level": "debug"
63+
},
6264
"plugins": [
6365
"config",
6466
"index"

0 commit comments

Comments
 (0)