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 /priv | |
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 'priv')
-rw-r--r-- | priv/config/rvi_common.config | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/priv/config/rvi_common.config b/priv/config/rvi_common.config index b9d9558..a84d10b 100644 --- a/priv/config/rvi_common.config +++ b/priv/config/rvi_common.config @@ -9,6 +9,20 @@ %% Configuration include file for rvi config files %% Out = filename:absname(proplists:get_value(outdir, OPTIONS)). +LagerRoot = Out ++ "/log/lager". +LagerDebugFmt = [time,"<",module,"/",line,">",message,"\n"]. + +%% Parameters for simpler modification +Env = fun(V, Def) -> + case os:getenv(V) of + false -> Def; + Str when is_integer(Def) -> list_to_integer(Str); + Str when is_atom(Def) -> list_to_atom(Str); + Str -> Str + end + end. + +LogLevel = Env("RVI_LOGLEVEL", info). [ %% All erlang apps needed to fire up a node. Do not touch. {apps, @@ -17,7 +31,9 @@ Out = filename:absname(proplists:get_value(outdir, OPTIONS)). sasl, setup, syntax_tools, + goldrush, lager, + %% ale, crypto, public_key, gproc, @@ -50,6 +66,7 @@ Out = filename:absname(proplists:get_value(outdir, OPTIONS)). bt, dlink, dlink_tcp, + dlink_tls, dlink_bt, dlink_sms, proto_bert, @@ -64,6 +81,37 @@ Out = filename:absname(proplists:get_value(outdir, OPTIONS)). [ {home, Out} ]}, + {lager, + [ + {log_root, LagerRoot}, + {crash_log, "crash.log"}, + {handlers, + [{lager_console_backend, + [LogLevel, {rvi_lager_formatter, + [{debug, LagerDebugFmt}]} + ]}, + {lager_file_backend, [{file, "error.log"}, {level, error}]}, + {lager_file_backend, [{file, "console.log"}, {level, LogLevel}, + {formatter, rvi_lager_formatter}, + {formatter_config, [{debug, LagerDebugFmt}]}]} + ]}, + {extra_sinks, + [ + {rvi_log_log_lager_event, + [{handlers, + [{lager_file_backend, [{file,"rvi_log.log"},{level,info}, + {formatter, lager_default_formatter}, + {formatter_config, + [time, " ", message, "\n"]} + ]} + ]} + ]} + ]} + ]}, + %% {ale, + %% [{init_traces, [ {[{module,rvi_log}, + %% {sink, rvi_log_log_lager_event}], info, LagerRoot ++ "/rvi_log.log"} ]}] + %% }, {rvi_core, [ ]} |