Added initial (empty) log handler.
authorStanislaw Klekot <dozzie@jarowit.net>
Mon, 8 Sep 2014 18:19:04 +0000 (20:19 +0200)
committerStanislaw Klekot <dozzie@jarowit.net>
Mon, 8 Sep 2014 18:19:04 +0000 (20:19 +0200)
src/haircut_log_h.erl [new file with mode: 0644]

diff --git a/src/haircut_log_h.erl b/src/haircut_log_h.erl
new file mode 100644 (file)
index 0000000..99741b8
--- /dev/null
@@ -0,0 +1,77 @@
+%%%---------------------------------------------------------------------------
+%%% @doc
+%%%   Log handler for {@link error_logger}.
+%%%   This is temporary module intended to work out how logs should be
+%%%   formatted and stored and what log types are to be handled by Indira.
+%%% @end
+%%%---------------------------------------------------------------------------
+
+-module(haircut_log_h).
+
+-behaviour(gen_event).
+
+%%% gen_event callbacks
+-export([init/1, terminate/2]).
+-export([handle_event/2, handle_call/2, handle_info/2]).
+-export([code_change/3]).
+
+%%%---------------------------------------------------------------------------
+%%% types
+
+-record(state, {}).
+
+%%%---------------------------------------------------------------------------
+%%% gen_event callbacks
+
+%%----------------------------------------------------------
+%% initialization and cleanup {{{
+
+%% @private
+%% @doc Initialize {@link gen_event} state.
+
+init(_Args) ->
+  {ok, #state{}}.
+
+%% @private
+%% @doc Clean up {@link gen_event} state.
+
+terminate(_Reason, _State) ->
+  ok.
+
+%% }}}
+%%----------------------------------------------------------
+%% communication {{{
+
+%% @private
+%% @doc Handle {@link gen_event:notify/2}.
+
+handle_event(_Event, State) ->
+  {ok, State}.
+
+%% @private
+%% @doc Handle {@link gen_event:call/3}.
+
+handle_call(_Request, State) ->
+  {ok, {error, unknown}, State}.
+
+%% @private
+%% @doc Handle incoming messages.
+
+handle_info(_Msg, State) ->
+  {ok, State}.
+
+%% }}}
+%%----------------------------------------------------------
+%% code change {{{
+
+%% @private
+%% @doc Handle code change.
+
+code_change(_OldVsn, State, _Extra) ->
+  {ok, State}.
+
+%% }}}
+%%----------------------------------------------------------
+
+%%%---------------------------------------------------------------------------
+%%% vim:ft=erlang:foldmethod=marker