diff --git a/rebar.config b/rebar.config index e7fcffc..7583293 100644 --- a/rebar.config +++ b/rebar.config @@ -1,7 +1,4 @@ {deps, [ {hackney, ".*", {git, "git://github.com/benoitc/hackney.git", {branch, "master"}}}, - %% lager dependency to override exometer's lager dependency, which does not compile on Erlang 19. - {lager, ".*", {git, "git://github.com/basho/lager.git", {tag, "3.2.1"}}}, - {exometer_core, ".*", {git, "git://github.com/Feuerlabs/exometer_core.git", "5fdd9426713a3c26cae32f644a3120711b1cdb64"}} + {exometer_core, ".*", {git, "git://github.com/Feuerlabs/exometer_core.git", "master"}} ]}. -{erl_opts, [{parse_transform, lager_transform}]}. diff --git a/src/exometer_influxdb.app.src b/src/exometer_influxdb.app.src index c5a8eb5..f275ce6 100644 --- a/src/exometer_influxdb.app.src +++ b/src/exometer_influxdb.app.src @@ -7,7 +7,6 @@ kernel, stdlib, hackney, - lager, exometer_core ]}, {env, []} diff --git a/src/exometer_report_influxdb.erl b/src/exometer_report_influxdb.erl index 72c9b69..7e605b7 100644 --- a/src/exometer_report_influxdb.erl +++ b/src/exometer_report_influxdb.erl @@ -120,7 +120,7 @@ exometer_init(Opts) -> state()) -> callback_result(). exometer_report(_Metric, _DataPoint, _Extra, _Value, #state{connection = undefined} = State) -> - ?debug("InfluxDB reporter isn't connected and will reconnect."), + ?info("InfluxDB reporter isn't connected and will reconnect."), {ok, State}; exometer_report(Metric, DataPoint, _Extra, Value, #state{metrics = Metrics} = State) -> @@ -176,8 +176,6 @@ exometer_info({exometer_influxdb, send}, #state{precision = Precision, collected_metrics = CollectedMetrics} = State) -> if CollectedMetrics /= #{} -> - ?debug("InfluxDB reporter send packet with ~p measurements", - [maps:size(CollectedMetrics)]), Packets = [make_packet(MetricName, Tags, Fileds, Timestamping, Precision) ++ "\n" || {_, {MetricName, Tags, Fileds, Timestamping}} <- maps:to_list(CollectedMetrics)], diff --git a/src/log.hrl b/src/log.hrl index 8443fcf..52b7514 100644 --- a/src/log.hrl +++ b/src/log.hrl @@ -5,38 +5,15 @@ -define(__LOG_HRL__, true). %% Lager logging levels -%% debug, info, notice, warning, error, critical, alert, emergency, none. +%% info, warning, error --define(debug(Fmt), lager:debug(Fmt)). --define(debug(Fmt, Args), lager:debug(Fmt, Args)). --define(debug(Attrs, Fmt, Args), lager:debug(Attrs, Fmt, Args)). +-define(info(Fmt), error_logger:info_msg(Fmt ++ "\n")). +-define(info(Fmt, Args), error_logger:info_msg(Fmt ++ "\n", Args)). --define(info(Fmt), lager:info(Fmt)). --define(info(Fmt, Args), lager:info(Fmt, Args)). --define(info(Attrs, Fmt, Args), lager:info(Attrs, Fmt, Args)). +-define(warning(Fmt), error_logger:warning_msg(Fmt ++ "\n")). +-define(warning(Fmt, Args), error_logger:warning_msg(Fmt ++ "\n", Args)). --define(notice(Fmt), lager:notice(Fmt)). --define(notice(Fmt, Args), lager:notice(Fmt, Args)). --define(notice(Attrs, Fmt, Args), lager:notice(Attrs, Fmt, Args)). - --define(warning(Fmt), lager:warning(Fmt)). --define(warning(Fmt, Args), lager:warning(Fmt, Args)). --define(warning(Attrs, Fmt, Args), lager:warning(Attrs, Fmt, Args)). - --define(error(Fmt), lager:error(Fmt)). --define(error(Fmt, Args), lager:error(Fmt, Args)). --define(error(Attrs, Fmt, Args), lager:error(Attrs, Fmt, Args)). - --define(critical(Fmt), lager:critical(Fmt)). --define(critical(Fmt, Args), lager:critical(Fmt, Args)). --define(critical(Attrs, Fmt, Args), lager:critical(Attrs, Fmt, Args)). - --define(alert(Fmt), lager:alert(Fmt)). --define(alert(Fmt, Args), lager:alert(Fmt, Args)). --define(alert(Attrs, Fmt, Args), lager:alert(Attrs, Fmt, Args)). - --define(emergency(Fmt), lager:emergency(Fmt)). --define(emergency(Fmt, Args), lager:emergency(Fmt, Args)). --define(emergency(Attrs, Fmt, Args), lager:emergency(Attrs, Fmt, Args)). +-define(error(Fmt), error_logger:error_msg(Fmt ++ "\n")). +-define(error(Fmt, Args), error_logger:error_msg(Fmt ++ "\n", Args)). -endif.