Skip to content

Commit

Permalink
feat(storefront): strf-9921 Hide logging for successful internal API …
Browse files Browse the repository at this point in the history
…calls in Stencil CLI: (#1033)

feat(storefront): strf-9921 Hide logging for successful internal API calls in Stencil CLI

BREAKING CHANGE: logging for successful internal API calls has been removed.
Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

bc-max authored Dec 8, 2022
1 parent bdb68de commit d8c2492
Showing 4 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/StencilCLISettings.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class StencilCLISettings {
constructor() {
// The setting enables/disables verbose network requests logging
this.versboseNetworkLogging = true;
this.versboseNetworkLogging = false;
// Enables usage of node sass fork for testing purposes
this.oldNodeSassFork = false;
}
@@ -11,7 +11,7 @@ class StencilCLISettings {
}

isVerbose() {
return this.versboseNetworkLogging === true;
return this.versboseNetworkLogging;
}

useOldNodeSassFork(flag) {
12 changes: 6 additions & 6 deletions lib/StencilCLISettings.spec.js
Original file line number Diff line number Diff line change
@@ -3,15 +3,15 @@ const stencilCLISettings = require('./StencilCLISettings');
describe('StencilCLISettings', () => {
afterEach(() => {
// setting to default
stencilCLISettings.setVerbose(true);
stencilCLISettings.setVerbose(false);
});

it('should set network logging to verbose by default', () => {
expect(stencilCLISettings.isVerbose()).toBeTruthy();
it('should set network logging to non-verbose by default', () => {
expect(stencilCLISettings.isVerbose()).toBeFalsy();
});

it('should set network logging to NOT verbose', () => {
stencilCLISettings.setVerbose(false);
expect(stencilCLISettings.isVerbose()).toBeFalsy();
it('should set network logging to verbose', () => {
stencilCLISettings.setVerbose(true);
expect(stencilCLISettings.isVerbose()).toBeTruthy();
});
});
2 changes: 1 addition & 1 deletion lib/cliCommon.js
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ function checkNodeVersion() {
function applyCommonOptions(program) {
program
.option('-h, --host [hostname]', 'specify the api host')
.option('-nov, --no-verbose', 'supress verbose info logging', false)
.option('-vb, --verbose', 'enable verbose info logging', false)
.option(
'--use-old-node-sass-fork',
'use old node sass fork for scss compilation during bundling',
6 changes: 2 additions & 4 deletions lib/utils/NetworkUtils.spec.js
Original file line number Diff line number Diff line change
@@ -224,7 +224,7 @@ describe('NetworkUtils', () => {
});

describe('log', () => {
it('should log the upcoming request', async () => {
it('should not log the upcoming request', async () => {
const axiosMock = jest.fn();
const httpsAgentMock = jest.fn();
const packageInfoMock = {
@@ -247,9 +247,7 @@ describe('NetworkUtils', () => {
accessToken,
});

expect(loggerMock.info).toHaveBeenCalledWith(
`Upcoming request ${`GET`.green}: ${url.green}`,
);
expect(loggerMock.info).not.toHaveBeenCalled();
});
});
});

0 comments on commit d8c2492

Please sign in to comment.