diff --git a/rebar.config b/rebar.config index d1f85a3..80915ed 100644 --- a/rebar.config +++ b/rebar.config @@ -22,9 +22,9 @@ {deps_dir, "deps"}. {deps, [ - {lager, "2.0.1", - {git, "git://github.com/basho/lager.git", - {tag, "2.0.1"}}} + {lager, ".*", + {git, "git://github.com/erlang-lager/lager.git", + {tag, "3.2.4"}}} ]}. {eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}. diff --git a/src/superman.erl b/src/superman.erl index c857da6..06b3664 100644 --- a/src/superman.erl +++ b/src/superman.erl @@ -45,7 +45,7 @@ reconfigure_supervisor(SupName, Specs) -> {Deleted, New, Changed, _Unchanged} = extract_children(SupName, Specs), reconfigure_supervisor_ll(SupName, Deleted, New, Changed, 0). - + start_children(Module, Config) -> start_children(Module, Module, Config). @@ -76,11 +76,18 @@ reconfigure_supervisor_tree(SupName, Specs) -> %%%====================================================== get_supervisor_state(SupPid) -> - {status, _Pid, {module, _Mod}, + {status, _Pid, {module, _Mod}, [_PDict, _SysState, _Parent, _Dbg, Misc]} = sys:get_status(SupPid), - case Misc of - [_Name, State1, _Type, _Time] -> State1; - [_Header, _Data, {data, [{"State", State2}]}] -> State2 + + %% loop through all data keys in the misc status + case lists:filtermap(fun(Data) -> + case proplists:get_value("State", Data) of + undefined -> false; + State -> {true, State} + end + end, proplists:get_all_values(data, Misc)) of + [] -> undefined; + [State] -> State end. reconfigure_supervisor_ll(SupName, Deleted, New, Changed, N) -> @@ -287,6 +294,6 @@ change_specs(Specs) -> lists:map(fun change_spec/1, Specs). change_spec({Id, MFA, _RestartType, Timeout, Type, Modules}) -> - {Id, MFA, some_type, Timeout, Type, Modules}. - + {Id, MFA, some_type, Timeout, Type, Modules}. + -endif.