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

SSG console prints _after_ page generation, preventing from debugging #9335

Closed
1 task done
y-nk opened this issue Dec 6, 2023 · 3 comments · Fixed by #9487
Closed
1 task done

SSG console prints _after_ page generation, preventing from debugging #9335

y-nk opened this issue Dec 6, 2023 · 3 comments · Fixed by #9487
Assignees
Labels
- P2: nice to have Not breaking anything but nice to have (priority) pkg: astro Related to the core `astro` package (scope)

Comments

@y-nk
Copy link
Contributor

y-nk commented Dec 6, 2023

Astro Info

Astro                    v3.6.0
Node                     v18.14.2
System                   macOS (arm64)
Package Manager          npm
Output                   hybrid
Adapter                  @astro-aws/adapter
Integrations             @y_nk/cached-fetch
                         @astrojs/tailwind
                         @astrojs/react
                         astro-robots-txt
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When generating static content, we have a nice print out in the console with url generated such as:

  ├─ /ja/__test/index.html (+309ms)
  ├─ /ja/legal/index.html (+1.26s)
  ├─ /de/people-management/index.html (+490ms)
  ├─ /taskcards/index.html (+585ms)
  ├─ /fr/taskcards/index.html (+576ms)
  ├─ /de/stickyad/index.html (+563ms)

...but these lines happen after the pages being successfully generated. If an error occur there's no way to know which page crashed the build, since the log is only printed after the page built, not before.

What's the expected result?

In my wildest dreams, I'd love to see the console printings such as:

  1. at build start (before the generatePath call), url of the page only ├─ /de/stickyad/index.html
  2. at build end (after the generatePath call), line amended with the build time of the path such as ├─ /de/stickyad/index.html (+563ms)

Optionally, for long builds it would be nice to have absolute time and completion % (based on pre computed page number) with the atomic build path duration. It is useful to know the build duration to spot slow pages, but it's also nice to have an idea of where are we in the build.

Link to Minimal Reproducible Example

https://example.com

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 6, 2023
@ematipico
Copy link
Member

As you suggested, you want to debug something, I think your suggestion might make sense for cases where the user uses --verbose logging output, I think it makes more sense to have more output using the .debug.

@ematipico ematipico added - P2: nice to have Not breaking anything but nice to have (priority) pkg: astro Related to the core `astro` package (scope) and removed needs triage Issue needs to be triaged labels Dec 6, 2023
@y-nk
Copy link
Contributor Author

y-nk commented Dec 6, 2023

@ematipico problem is that the --verbose is actually VERY verbose 😅 i always feel like this mode is mostly for plugin/astro internals rather than userland due to the vast amount of internal logging displayed.

...but yeah, maybe some flags would be nice.

@ematipico
Copy link
Member

Let me work on this. I have few ideas in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants