fix logger

This commit is contained in:
anlicheng 2025-02-18 18:09:25 +08:00
parent 522ed78c23
commit b274b48e3d

View File

@ -88,10 +88,13 @@ handle_cast({write, Data}, State = #state{file = {OldIoDevice, OldFilePath}, que
case maybe_new_file(Date, NDate) of
true ->
ok = file:close(OldIoDevice),
%%
erlang:spawn(fun() ->
%%
ok = erl_tar:create(OldFilePath ++ ".tar", [OldFilePath], [compressed]),
%%
ok = file:delete(OldFilePath),
ok = file:delete(OldFilePath)
end),
%%
NewFilePath = make_file(FileName, NDate),