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

fix: in dev mode pretty-print multi-line strings in logs #19266

Merged
merged 19 commits into from
Sep 20, 2024

Conversation

Platonn
Copy link
Contributor

@Platonn Platonn commented Sep 19, 2024

Now in dev mode we're using formatWithOptions() instead of JSON.stringify(). So now the output in the console in dev mode is more human-readable (including multi-line strings).

QA steps:

  1. in app.module.ts provide the following config chunk (causing HTTP call to backend to fail):
     provideConfig({
       backend: {
         occ: {
           endpoints: {
             components: 'some-fake-endpoint',
           },
         },
       },
     }),
  2. start SSR server - run npm run dev:ssr
  3. in another terminal curl http://localhost:4200
  4. In the logs of the SSR server, see the error message is now multi-line human-readable format. Also function's definitions in the [spartacus] SSR optimization engine initialized are also multi-line.

BEFORE (dev mode only screenshots):
image

image

image

AFTER:

a) DEV MODE:
image

image

image

b) PROD MODE:
image

image

image

fixes https://jira.tools.sap/browse/CXSPA-8385

@Platonn Platonn marked this pull request as ready for review September 19, 2024 14:01
@Platonn Platonn requested a review from a team as a code owner September 19, 2024 14:01
Base automatically changed from feature/CXSPA-8360 to develop September 19, 2024 14:44
@github-actions github-actions bot marked this pull request as draft September 20, 2024 09:02
@Platonn Platonn marked this pull request as ready for review September 20, 2024 09:05
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft September 20, 2024 09:14
@pawelfras pawelfras marked this pull request as ready for review September 20, 2024 09:27
Copy link
Contributor

@pawelfras pawelfras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. QA done.

Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft September 20, 2024 09:34
@Platonn Platonn marked this pull request as ready for review September 20, 2024 09:36
Copy link

cypress bot commented Sep 20, 2024

spartacus    Run #44950

Run Properties:  status check passed Passed #44950  •  git commit 90b4f07eef ℹ️: Merge f07f97ae15adb939490a524eb376c001e6ae2650 into 06f08ae33e54d788debbc46c03aa...
Project spartacus
Branch Review feature/CXSPA-8385
Run status status check passed Passed #44950
Run duration 03m 36s
Commit git commit 90b4f07eef ℹ️: Merge f07f97ae15adb939490a524eb376c001e6ae2650 into 06f08ae33e54d788debbc46c03aa...
Committer Krzysztof Platis
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 121
View all changes introduced in this branch ↗︎

@Platonn Platonn merged commit 356a370 into develop Sep 20, 2024
28 checks passed
@Platonn Platonn deleted the feature/CXSPA-8385 branch September 20, 2024 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants