Clean up user-facing output

This commit is contained in:
Craig Everett 2025-05-14 23:02:47 +09:00
parent 42bd267310
commit b340197713
2 changed files with 12 additions and 5 deletions

View File

@ -374,7 +374,6 @@ do_start_stop(#s{key = #key{id = PubKey}, network = Network}) ->
{pool_admin_url, Eureka}],
ok = gmc_gui:message({notice, "Starting..."}),
ok = gmc_gui:message({notice, ["Miner: ", Miner]}),
ok = gmc_gui:message(Profile),
{ok, Apps} = gmhc_app:start(Profile),
Started = io_lib:format("Apps started: ~p", [Apps]),
ok = log(info, Started),
@ -407,10 +406,11 @@ optimize_count() ->
end,
MeanMaps = Memory div (1_073_741_824 * 4),
Recommended = max(min(Procs, MeanMaps) - 1, 1),
ok = tell(info, "Physical Processors: ~p", [Procs]),
ok = tell(info, "Physical Memory: ~p", [Memory]),
ok = tell(info, "29-bit Mean Map Space: ~p", [MeanMaps]),
ok = tell(info, "Recommended Workers: ~p", [Recommended]),
Notice = fun(F, A) -> gmc_gui:message({notice, io_lib:format(F, A)}) end,
ok = Notice("Physical Processors: ~p", [Procs]),
ok = Notice("Physical Memory: ~p", [Memory]),
ok = Notice("29-bit Mean Map Space: ~p", [MeanMaps]),
ok = Notice("Recommended Workers: ~p", [Recommended]),
Recommended.

View File

@ -268,6 +268,7 @@ candidate(Block, #s{candy = Widget}) ->
do_message({notice, Notice}, State) ->
Entry = io_lib:format("~n~ts", [Notice]),
ok = log(info, Entry),
do_message2(Entry, State);
do_message({puzzle, #{info := {_, Diff, Nonce, _}}}, State = #s{diff = DiffT}) ->
DiffS = integer_to_list(Diff),
@ -303,6 +304,12 @@ do_message({pool_notification, #{info := #{msg := MSG}}}, State = #s{height = He
Entry = io_lib:format("~nUnexpected: ~tp", [Other]),
do_message2(Entry, State)
end;
do_message({connected, _}, State) ->
Entry = io_lib:format("~nConnected!"),
do_message2(Entry, State);
do_message({disconnected, _}, State) ->
Entry = io_lib:format("~nDisconnected!"),
do_message2(Entry, State);
do_message(Terms, State) ->
tell(info, "~p", [Terms]),
Entry = io_lib:format("~n~tp", [Terms]),