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
|
||||
true ->
|
||||
ok = file:close(OldIoDevice),
|
||||
%% 压缩文件
|
||||
ok = erl_tar:create(OldFilePath ++ ".tar", [OldFilePath], [compressed]),
|
||||
%% 删除原来的文件
|
||||
ok = file:delete(OldFilePath),
|
||||
%% 归档
|
||||
erlang:spawn(fun() ->
|
||||
%% 压缩文件
|
||||
ok = erl_tar:create(OldFilePath ++ ".tar", [OldFilePath], [compressed]),
|
||||
%% 删除原来的文件
|
||||
ok = file:delete(OldFilePath)
|
||||
end),
|
||||
|
||||
%% 开启新的文件
|
||||
NewFilePath = make_file(FileName, NDate),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user