Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

core: show info messages when a site starts/stops.

  • Loading branch information...
commit d6d7ab14767a248198e339180c95c4b3a1ed2cf8 1 parent 99325a1
@mworrell mworrell authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/support/z_sites_manager.erl
View
12 src/support/z_sites_manager.erl
@@ -124,6 +124,7 @@ restart(Site) ->
%% @doc Initiates the server.
init([]) ->
{ok, Sup} = z_supervisor:start_link([]),
+ z_supervisor:set_manager_pid(Sup, self()),
ets:new(?MODULE_INDEX, [set, public, named_table, {keypos, #module_index.key}]),
ets:new(?MEDIACLASS_INDEX, [set, public, named_table, {keypos, #mediaclass_index.key}]),
add_sites_to_sup(Sup, scan_sites()),
@@ -189,6 +190,17 @@ handle_cast({restart, Site}, State) ->
z_supervisor:restart_child(State#state.sup, Site),
{noreply, State};
+%% @doc A site started - report
+handle_cast({supervisor_child_started, Child, SitePid}, State) ->
+ lager:info("Site started: ~p (~p)", [Child#child_spec.name, SitePid]),
+ {noreply, State};
+
+%% @doc A site stopped - report
+handle_cast({supervisor_child_stopped, Child, SitePid}, State) ->
+ lager:info("Site stopped: ~p (~p)", [Child#child_spec.name, SitePid]),
+ {noreply, State};
+
+
%% @doc Trap unknown casts
handle_cast(Message, State) ->
{stop, {unknown_cast, Message}, State}.
Please sign in to comment.
Something went wrong with that request. Please try again.