@gleam_env(dev, test, prod) compiler env filter #3133
Replies: 5 comments 1 reply
-
More thoughts
|
Beta Was this translation helpful? Give feedback.
-
Could you give some use cases and examples of how this would be used? Thanks. |
Beta Was this translation helpful? Give feedback.
-
the closest you can get in rust is |
Beta Was this translation helpful? Give feedback.
-
my use case would be debug info existing locally or on stage but not on production. |
Beta Was this translation helpful? Give feedback.
-
a more generalized form would be @env(MY_ENV_VAR=dev || MY_ENV_VAR=test) {
// debug code here
} |
Beta Was this translation helpful? Give feedback.
-
Similar to MIX_ENV dev/test/prod.
Pass in GLEAM_ENV and certain blocks will be ignored or compiled.
This could be used to add telemetry for production or remove debug logging for production, e.g. the code would in both envs compile without/with those blocks.
maybe something like this
Beta Was this translation helpful? Give feedback.
All reactions