-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger.erl
More file actions
33 lines (26 loc) · 1.04 KB
/
logger.erl
File metadata and controls
33 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
%%%----------------------------------------------------
%%% Copyright AnalyzERL 2011
%%% All rights reserved. No part of this computer programs(s) may be
%%% used, reproduced,stored in any retrieval system, or transmitted,
%%% in any form or by any means, electronic, mechanical, photocopying,
%%% recording, or otherwise without prior written permission of
%%% the authors
%%%---------------------------------------------------------------------
%%%---------------------------------------------------------------------
%%% Revision History
%%%---------------------------------------------------------------------
%%% Revision 1.0 Author: Souvik Ray (rsouvik@gmail.com)
%%%---------------------------------------------------------------------
-module(logger).
-compile(export_all).
init(File) ->
{ok, Fd} = file:open(File, write),
Fd.
terminate(Fd) -> file:close(Fd).
handle_event(Event, Fd) ->
{MegaSec, Sec, MicroSec} = now(),
Args = io:format(Fd, "~w,~w,~w,~p~n",
[MegaSec, Sec, MicroSec, Event]),
Fd;
handle_event(_, Fd) ->
Fd.