-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: STRF-9741 Verbose error logging in Stencil CLI
- Loading branch information
Showing
12 changed files
with
159 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
class StencilCLISettings { | ||
constructor() { | ||
// The setting enables/disables verbose network requests logging | ||
this.versboseNetworkLogging = true; | ||
} | ||
|
||
setVerbose(flag) { | ||
this.versboseNetworkLogging = flag; | ||
} | ||
|
||
isVerbose() { | ||
return this.versboseNetworkLogging === true; | ||
} | ||
} | ||
|
||
|
||
const settings = new StencilCLISettings(); | ||
|
||
|
||
module.exports = settings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const stencilCLISettings = require('./StencilCLISettings'); | ||
|
||
|
||
describe('StencilCLISettings', () => { | ||
afterEach(() => { | ||
// setting to default | ||
stencilCLISettings.setVerbose(true); | ||
}); | ||
|
||
it('should set network logging to verbose by default', () => { | ||
expect(stencilCLISettings.isVerbose()).toBeTruthy(); | ||
}); | ||
|
||
it('should set network logging to NOT verbose', () => { | ||
stencilCLISettings.setVerbose(false); | ||
expect(stencilCLISettings.isVerbose()).toBeFalsy(); | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.