3 ms·
I haven't seen it used directly, but it seems like Elixir macro based code could be altered and recompiled based on runtime configuration. An example would be
by roller 10y ago
I haven't seen it used directly, but it seems like Elixir macro based code could be altered and recompiled based on runtime configuration.
An example would be changing log level settings. Normally Elixir log blocks can be compiled entirely out when running in production mode. But it should be possible to fairly safely recompile with debug logs enabled and reload without missing a beat.
- e_proxus 10y agoWe do this in our project, for two reasons. One for logging (as you mentioned) and the other for configuration (compiling configuration into a module for efficiency reasons). The Elixir primitives makes this a breeze.