Skip to content

Commit

Permalink
feature: io:format -> logger
Browse files Browse the repository at this point in the history
  • Loading branch information
mpope9 committed Aug 31, 2024
1 parent 553e375 commit f658746
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/luerl_comp.erl
Original file line number Diff line number Diff line change
Expand Up @@ -313,17 +313,17 @@ debug_print(Opts, Format, Args) ->
list_warnings(F, Ws) ->
foreach(fun ({Line,Mod,Warn}) ->
Cs = Mod:format_error(Warn),
io:format("~s:~w: Warning: ~s\n", [F,Line,Cs]);
logger:warning("~s:~w: Warning: ~s\n", [F,Line,Cs]);
({Mod,Warn}) ->
Cs = Mod:format_error(Warn),
io:format("~s: Warning: ~s\n", [F,Cs])
logger:warning("~s: Warning: ~s\n", [F,Cs])
end, Ws).

list_errors(F, Es) ->
foreach(fun ({Line,Mod,Error}) ->
Cs = Mod:format_error(Error),
io:format("~s:~w: ~s\n", [F,Line,Cs]);
logger:error("~s:~w: ~s\n", [F,Line,Cs]);
({Mod,Error}) ->
Cs = Mod:format_error(Error),
io:format("~s: ~s\n", [F,Cs])
logger:error("~s: ~s\n", [F,Cs])
end, Es).
6 changes: 3 additions & 3 deletions src/luerl_lib_basic.erl
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ collectgarbage(_, _, St) -> %Ignore everything else
eprint(_, Args, St) ->
lists:foreach(fun (#tref{}=Tref) ->
Tab = luerl_heap:get_table(Tref, St),
io:format("~w ", [Tab]);
(A) -> io:format("~w ", [A])
logger:error("~w ", [Tab]);
(A) -> logger:error("~w ", [A])
end, Args),
io:nl(),
{[],St}.
Expand Down Expand Up @@ -204,7 +204,7 @@ next_key(K, Dict, St) ->
print(_, Args, St0) ->
St1 = lists:foldl(fun (A, S0) ->
{[Str],S1} = tostring([A], S0),
io:format("~ts ", [Str]),
logger:info("~ts ", [Str]),
S1
end, St0, Args),
io:nl(),
Expand Down
2 changes: 1 addition & 1 deletion src/luerl_lib_io.erl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ write(_, As, St) ->
case luerl_lib:args_to_strings(As) of
error -> badarg_error(write, As, St);
Ss ->
lists:foreach(fun (S) -> io:format("~s", [S]) end, Ss),
lists:foreach(fun (S) -> logger:info("~s", [S]) end, Ss),
{[#userdata{d=standard_io}],St}
end.

0 comments on commit f658746

Please sign in to comment.