Skip to content

Commit 6b3c815

Browse files
committed
fix The function passed as a handler with ID ecron_telemetry_logger is a local function., This means that it is either an anonymous function or a capture of a function without a module specified. That may cause a performance penalty when calling that handler
1 parent 8752e0e commit 6b3c815

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.rebar3
2+
.tool-versions
23
deps
34
doc
45
_*

src/ecron_telemetry_logger.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
crashed => error
1818
}).
1919
%% API
20-
-export([attach/0, detach/0]).
20+
-export([attach/0, detach/0, handle_event/4]).
2121

2222
attach() ->
2323
Level = application:get_env(ecron, log_level, all),
2424
logger:set_module_level([?MODULE], Level),
25-
Function = fun handle_event/4,
25+
Function = fun ?MODULE:handle_event/4,
2626
Config = undefined,
2727
telemetry:attach_many(?MODULE, ?Events, Function, Config).
2828

0 commit comments

Comments
 (0)