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

Write to std in hook does not write to console #3796

Open
3 tasks done
mingpepe opened this issue Jan 7, 2025 · 3 comments
Open
3 tasks done

Write to std in hook does not write to console #3796

mingpepe opened this issue Jan 7, 2025 · 3 comments

Comments

@mingpepe
Copy link

mingpepe commented Jan 7, 2025

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.3.0

Electron version

29.1.1

Operating system

Windows 10

Last known working Electron Forge version

N

Expected behavior

Print to console as state in doc.

Actual behavior

Log in hook does not display on console.

Steps to reproduce

npx electron-forge package

Additional information

Same discuss on reddit and discord.

@MarshallOfSound
Copy link
Member

@mingpepe Forge doesn't have could wiring to allow hooks or plugins to write logs outside of the existing listr infra, specifically the reason your log "doesn't show up" is because listr overwrites it immediately.

If you want to see your logs a valid workaround is to do DEBUG=*forge* electron-forge and then your console logs should be visible easily

@mingpepe
Copy link
Author

mingpepe commented Jan 7, 2025

Thanks! It works for me.

@mingpepe mingpepe closed this as completed Jan 7, 2025
@mingpepe
Copy link
Author

mingpepe commented Jan 7, 2025

@MarshallOfSound Do you think the document should be modified? I think it's misleading.

Any writes to stdout and stderr from within a hook function will be printed in the console after the Forge build completes.

@mingpepe mingpepe reopened this Jan 7, 2025
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

No branches or pull requests

2 participants