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

Logging queue hangs and statements aren't logged with version >= 5 #858

Open
millerds opened this issue Feb 11, 2025 · 1 comment
Open

Comments

@millerds
Copy link

I'm using a custom generator that has many "this.log" statements. In a couple of code paths, I have a method that makes a series of log calls. One gets called from "initializing" and one gets called from "end". In those two cases only the first log statement gets output and the rest do not. At the same time, the "tihs.log(yosay(message));" in initializing doesn't prevent other log calls from working and neither does a call to another custom logging method being called under "writing". This started happening after I updated my 'yo' installation to v5 without changing the generator itself.

I debugged into my generator project and can see all the logging statements getting added to the queue but the first statement in those two cases seems to log and then then the queue has an "await" call after calling the log and that isn't getting resolved before all the other statements get logged and the method finished.

Based on the previous observation I awaited all my this.log calls (and made all the methods async) and that seems to work around the problem. I don't believe the log call itself it async so I'm a little confused about how this is working.

@JoshuaKGoldberg
Copy link

Not that I don't believe you, but it's not feasible to take action on a description without a reproduction. Could you please provide an minimum reproduction that we can look at? https://antfu.me/posts/why-reproductions-are-required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants