View Source Conion.Common.Configuration (conion v0.1.0)

General functions to deal with runtime configuration

Summary

Functions

Same as load!/1 but rescue from raise and returns a error tuple {:error, err}.

Loads the environment ENV from env. If it is not defined, returns the mix-configuration for app, key, default. The !-version may raise errors.

Loads the configuration for a given key {_env, _app, _key, _default} and calls the set_function/1 with the loaded value.

Set the log-level. You can pass one of the following values. Either as binary or atom: notice, debug, warning, error

Functions

load(conf_key)

Same as load!/1 but rescue from raise and returns a error tuple {:error, err}.

load!(conf_key)

Loads the environment ENV from env. If it is not defined, returns the mix-configuration for app, key, default. The !-version may raise errors.

load_configuration_for(arg, config)

Loads the configuration for a given key {_env, _app, _key, _default} and calls the set_function/1 with the loaded value.

set_log_level(level_string_or_atom)

Set the log-level. You can pass one of the following values. Either as binary or atom: notice, debug, warning, error