-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Pass debug flag into template (Nunjuck and filters) #369
Comments
I'm not sure we have to overcomplicate with some additional params, especially reserved ones. Here we should look at the UX more, and the user that will trigger generation. Users will not have a strong knowledge of tooling and should not be forced to think about debugging generator or debugging template, but debugging generation process, which involves both, generator and template. We should think about the generator as a helper/framework in my opinion, and templates as specific generators, that just use the framework. So you debug generation process, and not one or another project. Anyway, it would be awesome to see it implemented. I saw that some filters in some templates have |
I'd instead use something like https://www.npmjs.com/package/debug. This way we could do:
It's pretty much the standard way of debugging apps these days. |
|
Why choosing? Just make --debug to set the DEBUG env to something like Try using the DEBUG env with any CLI tool, you would be surprised 😄 |
Nothing against And I checked DEBUG with GitHub CLI and npm and got only disappointed 😛 it can't be better than doing My past experience is, control server with environment variables, but with CLI stick to CLI options. |
We're talking 2 different things here. With a debug param like
I love it. It gives me control :) Although, using the syntax described above would be better maybe. Also, don't forget that some people will use the Generator in CI systems and you might want to have certain logs depending on your environment. Same command, different logs options depending on the env var. For instance, I may want to see some logs on staging but not on production. Or I'm having trouble and want to see what's happening. Changing an environment variable is usually handier than re-deploying to see logs. |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
update Generator CLI will be removed, as AsyncAPI CLI supports generator now. So there is no need to discuss if so scope is:
breaking change? if we go with |
is this still valid? (After nunjucks depreciation) cc @derberg |
yes, we still need it in templates, no matter what rendering engine is used, we still need unified logging |
Is it still valid? If so I would like to work on it @derberg |
we need to first decide if we stay with current logger solution or not |
Reason/Context
In the #363 debug flag was extended to provide more information, this is nice feature which could be pleasant in templates.
Pass debug flag in the way that it will be available in Nunjuck and so in filters.
Description
Maybe it's make sense to reserve parameter like
generator-debug
which will betrue
if you run generator with--debug
. Not justdebug
because parameter with such name could be useful for template itself.The text was updated successfully, but these errors were encountered: