diff options
author | Ulf Wiger <ulf@feuerlabs.com> | 2015-10-28 21:23:05 +0100 |
---|---|---|
committer | Ulf Wiger <ulf@feuerlabs.com> | 2015-11-20 13:46:13 -0800 |
commit | 1b44c2448344a10ae63904a796b6211c40a3f212 (patch) | |
tree | ce8f7dda870a5c454ffbe9e2c0bc7035b34f0f4b /src | |
parent | 34aa86b5a2e97650fe6299ccf794d5eb5d052d91 (diff) | |
download | rvi_core-1b44c2448344a10ae63904a796b6211c40a3f212.tar.gz |
Lots of changes to make dlink_bt (simulated) and dlink_tls runtime tests pass
* Introduced high-level logging (rvi_log)
* Upgraded to new lager version, customized debug output
* Thread rvi_log IDs between nodes and components
* Introduce simplified protocol for dlink_tls
* Use msgpack encoding for dlink_tls
* dlink_bt can use TCP instead of Bluetooth for testing purposes
* Bug fixes and additions to the test suite
Diffstat (limited to 'src')
-rw-r--r-- | src/rvi_lager_formatter.erl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/rvi_lager_formatter.erl b/src/rvi_lager_formatter.erl new file mode 100644 index 0000000..07c54be --- /dev/null +++ b/src/rvi_lager_formatter.erl @@ -0,0 +1,20 @@ +-module(rvi_lager_formatter). + +-export([format/2, + format/3]). + + +format(Msg, Config) -> + format(Msg, Config, []). + +format(Msg, Config, Colors) -> + C = get_config(lager_msg:severity(Msg), Config), + lager_default_formatter:format(Msg, C, Colors). + +get_config(Severity, Config) -> + case lists:keyfind(Severity, 1, Config) of + {_, Res} -> + Res; + _ -> + [] + end. |