mirror of
https://github.com/correl/rebar.git
synced 2024-12-17 19:16:11 +00:00
61 lines
1.5 KiB
Erlang
61 lines
1.5 KiB
Erlang
|
-module({{eventid}}).
|
||
|
-behaviour(gen_event).
|
||
|
|
||
|
%% ------------------------------------------------------------------
|
||
|
%% API Function Exports
|
||
|
%% ------------------------------------------------------------------
|
||
|
|
||
|
-export([start_link/0,
|
||
|
add_handler/2]).
|
||
|
|
||
|
%% ------------------------------------------------------------------
|
||
|
%% gen_event Function Exports
|
||
|
%% ------------------------------------------------------------------
|
||
|
|
||
|
-export([init/1,
|
||
|
handle_event/2,
|
||
|
handle_call/2,
|
||
|
handle_info/2,
|
||
|
terminate/2,
|
||
|
code_change/3]).
|
||
|
|
||
|
-record(state, {}).
|
||
|
|
||
|
%% ------------------------------------------------------------------
|
||
|
%% API Function Definitions
|
||
|
%% ------------------------------------------------------------------
|
||
|
|
||
|
start_link() ->
|
||
|
gen_event:start_link({local, ?MODULE}).
|
||
|
|
||
|
add_handler(Handler, Args) ->
|
||
|
gen_event:add_handler(?MODULE, Handler, Args).
|
||
|
|
||
|
%% ------------------------------------------------------------------
|
||
|
%% gen_event Function Definitions
|
||
|
%% ------------------------------------------------------------------
|
||
|
|
||
|
init([]) ->
|
||
|
{ok, #state{}}.
|
||
|
|
||
|
handle_event(_Event, State) ->
|
||
|
{ok, State}.
|
||
|
|
||
|
handle_call(_Request, State) ->
|
||
|
Reply = ok,
|
||
|
{ok, Reply, State}.
|
||
|
|
||
|
handle_info(_Info, State) ->
|
||
|
{ok, State}.
|
||
|
|
||
|
terminate(_Reason, _State) ->
|
||
|
ok.
|
||
|
|
||
|
code_change(_OldVsn, State, _Extra) ->
|
||
|
{ok, State}.
|
||
|
|
||
|
%% ------------------------------------------------------------------
|
||
|
%% Internal Function Definitions
|
||
|
%% ------------------------------------------------------------------
|
||
|
|