fix logger
This commit is contained in:
parent
522ed78c23
commit
b274b48e3d
@ -88,10 +88,13 @@ handle_cast({write, Data}, State = #state{file = {OldIoDevice, OldFilePath}, que
|
|||||||
case maybe_new_file(Date, NDate) of
|
case maybe_new_file(Date, NDate) of
|
||||||
true ->
|
true ->
|
||||||
ok = file:close(OldIoDevice),
|
ok = file:close(OldIoDevice),
|
||||||
%% 压缩文件
|
%% 归档
|
||||||
ok = erl_tar:create(OldFilePath ++ ".tar", [OldFilePath], [compressed]),
|
erlang:spawn(fun() ->
|
||||||
%% 删除原来的文件
|
%% 压缩文件
|
||||||
ok = file:delete(OldFilePath),
|
ok = erl_tar:create(OldFilePath ++ ".tar", [OldFilePath], [compressed]),
|
||||||
|
%% 删除原来的文件
|
||||||
|
ok = file:delete(OldFilePath)
|
||||||
|
end),
|
||||||
|
|
||||||
%% 开启新的文件
|
%% 开启新的文件
|
||||||
NewFilePath = make_file(FileName, NDate),
|
NewFilePath = make_file(FileName, NDate),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user