Compare commits

..

2 Commits

Author SHA1 Message Date
d23196e746 Remove final logger include 2025-10-14 10:47:02 +09:00
e9b1bccf57 Make hz friendlier to non-zx projects 2025-10-14 10:45:04 +09:00
2 changed files with 12 additions and 5 deletions

View File

@ -6,8 +6,6 @@
-export([connect/4, slowly_connect/4]).
-include("$zx_include/zx_logger.hrl").
connect(Node = {Host, Port}, Request, From, Timeout) ->
Timer = erlang:send_after(Timeout, self(), timeout),
@ -236,3 +234,9 @@ url({Node, Port}, Path) when is_list(Node) ->
["https://", Node, ":", integer_to_list(Port), Path];
url({Node, Port}, Path) when is_tuple(Node) ->
["https://", inet:ntoa(Node), ":", integer_to_list(Port), Path].
log(Level, Format, Args) ->
Raw = io_lib:format("~w ~w: " ++ Format, [?MODULE, self() | Args]),
Entry = unicode:characters_to_list(Raw),
logger:log(Level, Entry).

View File

@ -28,9 +28,6 @@
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
code_change/3, terminate/2]).
%% TODO: Make logging more flexible
-include("$zx_include/zx_logger.hrl").
%%% Type and Record Definitions
@ -268,3 +265,9 @@ do_request(Request,
do_request(Request, From, State = #s{chain_nodes = {[], Used}}) ->
Fresh = lists:reverse(Used),
do_request(Request, From, State#s{chain_nodes = {Fresh, []}}).
log(Level, Format, Args) ->
Raw = io_lib:format("~w ~w: " ++ Format, [?MODULE, self() | Args]),
Entry = unicode:characters_to_list(Raw),
logger:log(Level, Entry).