Skip to content

Commit

Permalink
forget about logging, lets keep it minimal
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Fenoll <[email protected]>
  • Loading branch information
fenollp authored and LesnyRumcajs committed Jan 10, 2022
1 parent 02b31b4 commit 3cfb850
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 30 deletions.
9 changes: 0 additions & 9 deletions erlang_grpcbox_bench/config/sys.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,4 @@
}]}
]}

,{kernel, [{logger_level, debug}
,{logger, [{handler, default, logger_std_h, #{formatter => {flatlog, #{map_depth => 3
,term_depth => 50
,colored => true
}}
}}
]}
]}

].
1 change: 0 additions & 1 deletion erlang_grpcbox_bench/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

{deps, [grpcbox
,{chatterbox, {git, "https://github.com/psalin/chatterbox.git", {branch, "fix_rst_stream"}}} %% TODO(fenollp): drop whence https://github.com/tsloughter/chatterbox/pull/12
,flatlog
]}.

{grpc, [{protos, "../proto/helloworld"}
Expand Down
3 changes: 0 additions & 3 deletions erlang_grpcbox_bench/rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@
{ref,"50f570fb82a239292615663ac246df74cecb5a12"}},
0},
{<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},1},
{<<"flatlog">>,{pkg,<<"flatlog">>,<<"0.1.2">>},0},
{<<"gproc">>,{pkg,<<"gproc">>,<<"0.8.0">>},1},
{<<"grpcbox">>,{pkg,<<"grpcbox">>,<<"0.14.0">>},0},
{<<"hpack">>,{pkg,<<"hpack_erl">>,<<"0.2.3">>},1}]}.
[
{pkg_hash,[
{<<"acceptor_pool">>, <<"43C20D2ACAE35F0C2BCD64F9D2BDE267E459F0F3FD23DAB26485BF518C281B21">>},
{<<"ctx">>, <<"8FF88B70E6400C4DF90142E7F130625B82086077A45364A78D208ED3ED53C7FE">>},
{<<"flatlog">>, <<"8C4B81A4931A1396254DBD975B841F4A6350D6F128FF94FFE86799A4451E32B1">>},
{<<"gproc">>, <<"CEA02C578589C61E5341FCE149EA36CCEF236CC2ECAC8691FBA408E7EA77EC2F">>},
{<<"grpcbox">>, <<"3EB321BCD2275BAF8B54CF381FEB7B0559A50C02544DE28FDA039C7F2F9D1A7A">>},
{<<"hpack">>, <<"17670F83FF984AE6CD74B1C456EDDE906D27FF013740EE4D9EFAA4F1BF999633">>}]},
{pkg_hash_ext,[
{<<"acceptor_pool">>, <<"0CBCD83FDC8B9AD2EEE2067EF8B91A14858A5883CB7CD800E6FCD5803E158788">>},
{<<"ctx">>, <<"A14ED2D1B67723DBEBBE423B28D7615EB0BDCBA6FF28F2D1F1B0A7E1D4AA5FC2">>},
{<<"flatlog">>, <<"FDD2A311A67F63F9D0BC194FAD6BEAF9CCCDE8FFFEE2919DF1C4D86098E49984">>},
{<<"gproc">>, <<"580ADAFA56463B75263EF5A5DF4C86AF321F68694E7786CB057FD805D1E2A7DE">>},
{<<"grpcbox">>, <<"E24159B7B6D3F9869BBE528845C0125FED2259366BA908FD04A1F45FE81D0660">>},
{<<"hpack">>, <<"06F580167C4B8B8A6429040DF36CC93BBA6D571FAEAEC1B28816523379CBB23A">>}]}
Expand Down
18 changes: 2 additions & 16 deletions erlang_grpcbox_bench/src/egb_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,12 @@
-module(egb_handler).
-behavior(helloworld_greeter_bhvr).

-include_lib("kernel/include/logger.hrl").

-export([say_hello/2]).

-define(NOW(), erlang:monotonic_time()).
-define(SINCE(T), erlang:convert_time_unit(?NOW()-T, native, microsecond)).

%% @doc Unary RPC
-spec say_hello(ctx:ctx(), helloworld_pb:hello_request()) ->
{ok, helloworld_pb:hello_reply(), ctx:ctx()} | grpcbox_stream:grpc_error_response().

say_hello(Ctx, Req) ->
StartTime = erlang:monotonic_time(),
?LOG_DEBUG(#{status=>handling, req=>Req}),

#{name := Name
} = Req,

Rep = #{message => Name
},

?LOG_INFO(#{status=>handled, rep=>Rep, in_us=>?SINCE(StartTime)}),
say_hello(Ctx, #{name := Name}) ->
Rep = #{message => Name},
{ok, Rep, Ctx}.
1 change: 0 additions & 1 deletion erlang_grpcbox_bench/src/erlang_grpcbox_bench.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
,{applications, [kernel
,stdlib
,sasl
,flatlog
,ctx
,grpcbox
]}
Expand Down

0 comments on commit 3cfb850

Please sign in to comment.