[erlang-questions] Application environment

Ulf Wiger ulf@REDACTED
Thu May 28 07:34:45 CEST 2015


> On 27 May 2015, at 22:39, Serge Aleynikov <serge@REDACTED> wrote:
> 
> Is it possible to override application's startup environment dynamically if its *.app file contains an {env, [...]} clause?

What one normally does is:

application:load(App),
application:set_env(App, …)
…
application:start(App)

If the application wasn’t loaded before, the start function will perform a load, which will override your changes (unless you’ve used the ‘persistent’ option as mentioned).

A corresponding trick to clear the environment is to use application:unload(App) in the test cleanup function.

BR,
Ulf W

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
http://feuerlabs.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150528/b68e546f/attachment.htm>


More information about the erlang-questions mailing list