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

chore(in-4422): logger prettier #7360

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
chore(in-4422): logger changeset
lukasborawski committed Dec 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 7483a5d7a778e98c1a3534119883a96eac230ea6
5 changes: 5 additions & 0 deletions .changeset/poor-swans-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-storefront/logger": minor
---

**[ADDED]** Alokai Logger Prettier. Now the output of **the Alokai Logger** will be formatted with readable and accessible way.

Unchanged files with check annotations Beta

import { baseConfig } from "@vue-storefront/jest-config";

Check warning on line 1 in packages/sdk-axios-request-sender/jest.config.ts

GitHub Actions / Continuous Integration / Run CI

'@vue-storefront/jest-config' should be listed in the project's dependencies. Run 'npm i -S @vue-storefront/jest-config' to add it
export default {
...baseConfig,
import { generateSDKConfig } from "@vue-storefront/rollup-config";

Check warning on line 1 in packages/sdk-axios-request-sender/rollup.config.js

GitHub Actions / Continuous Integration / Run CI

'@vue-storefront/rollup-config' should be listed in the project's dependencies. Run 'npm i -S @vue-storefront/rollup-config' to add it
import package_ from "./package.json";
export default [generateSDKConfig(package_)];
it("it logs at the correct level", () => {
const logger = createConsolaStructuredLogger(mockStructuredLog);
const infoSpy = jest.spyOn(logger, "info").mockImplementation(() => {});

Check warning on line 31 in packages/logger/__tests__/unit/consolaStructuredLogger.spec.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected empty arrow function
logger.info(logData, metadata);
expect(infoSpy).toHaveBeenCalledTimes(1);
const errorSpy = jest.spyOn(logger, "error").mockImplementation(() => {});

Check warning on line 35 in packages/logger/__tests__/unit/consolaStructuredLogger.spec.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected empty arrow function
logger.error(logData, metadata);
expect(errorSpy).toHaveBeenCalledTimes(1);
const debugSpy = jest.spyOn(logger, "debug").mockImplementation(() => {});

Check warning on line 39 in packages/logger/__tests__/unit/consolaStructuredLogger.spec.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected empty arrow function
expect(debugSpy).not.toHaveBeenCalled();
});
it("calls console.warn once when logger.warning is invoked", () => {
const logger = createConsolaStructuredLogger(mockStructuredLog);
const warnSpy = jest.spyOn(console, "warn").mockImplementation(() => {});

Check warning on line 45 in packages/logger/__tests__/unit/consolaStructuredLogger.spec.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected empty arrow function
logger.warning(logData, metadata);
it("calls console.error once for each error-level logging method", () => {
const logger = createConsolaStructuredLogger(mockStructuredLog);
const errorSpy = jest.spyOn(console, "error").mockImplementation(() => {});

Check warning on line 56 in packages/logger/__tests__/unit/consolaStructuredLogger.spec.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected empty arrow function
logger.error(logData, metadata);
logger.critical(logData, metadata);
it("calls console.info once when info-level is invoked", () => {
const logger = createConsolaStructuredLogger(mockStructuredLog);
const infoSpy = jest.spyOn(console, "info").mockImplementation(() => {});

Check warning on line 70 in packages/logger/__tests__/unit/consolaStructuredLogger.spec.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected empty arrow function
logger.info(logData, metadata);
let warnSpy: jest.SpyInstance;
beforeEach(() => {
consoleSpy = jest.spyOn(console, "log").mockImplementation(() => {});

Check warning on line 8 in packages/logger/__tests__/unit/reporter/consola/jsonReporter.spec.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected empty arrow function
warnSpy = jest.spyOn(console, "warn").mockImplementation(() => {});

Check warning on line 9 in packages/logger/__tests__/unit/reporter/consola/jsonReporter.spec.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected empty arrow function
});
afterEach(() => {