From 60cb9672a11ef4e3e2c1ad53e9e674215aef6cae Mon Sep 17 00:00:00 2001 From: SisMaker <1713699517@qq.com> Date: Thu, 17 Feb 2022 15:08:56 +0800 Subject: [PATCH] =?UTF-8?q?ft:=20=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/crashLog/lgCrashLog.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/crashLog/lgCrashLog.erl b/src/crashLog/lgCrashLog.erl index cba9643..cdd7aea 100644 --- a/src/crashLog/lgCrashLog.erl +++ b/src/crashLog/lgCrashLog.erl @@ -139,7 +139,7 @@ saslLimitedStr(supervisor_report, Report, FmtMaxBytes) -> Context = lgUtil:sup_get(errorContext, Report), Reason = lgUtil:sup_get(reason, Report), Offender = lgUtil:sup_get(offender, Report), - FmtString = <<" Supervisor: ~p~n Context: ~p~n Reason: ~s~n Offender: ~s~n~n">>, + FmtString = <<" Supervisor: ~p~n Context: ~p~n Reason: ~s~n Offender: ~s~n">>, ReasonStr = eFmt:formatBin(<<"~p">>, [Reason], [{charsLimit, FmtMaxBytes}]), OffenderStr = eFmt:formatBin(<<"~p">>, [Offender], [{charsLimit, FmtMaxBytes}]), eFmt:format(FmtString, [Name, Context, ReasonStr, OffenderStr]); @@ -151,7 +151,7 @@ saslLimitedStr(progress, Report, FmtMaxBytes) -> end || {Tag, Data} <- Report ]; saslLimitedStr(crash_report, Report, FmtMaxBytes) -> - eFmt:formatBin(<<"~p~n">>, [Report], [{charsLimit, FmtMaxBytes}]). + eFmt:formatBin(<<"~p">>, [Report], [{charsLimit, FmtMaxBytes}]). writeLog(Event, #state{fileName = FileName, fd = FD, inode = Inode, cTime = CTime, flap = Flap, maxFmtSize = FmtMaxBytes, maxFileSize = RotSize, rotator = Rotator} = State) -> {ReportStr, Pid, MsgStr, _ErrorP} = @@ -159,7 +159,7 @@ writeLog(Event, #state{fileName = FileName, fd = FD, inode = Inode, cTime = CTim {error, _GL, {Pid1, Fmt, Args}} -> {<<"ERROR REPORT">>, Pid1, eFmt:formatBin(Fmt, Args, [{charsLimit, FmtMaxBytes}]), true}; {error_report, _GL, {Pid1, std_error, Rep}} -> - {<<"ERROR REPORT">>, Pid1, eFmt:formatBin(<<"~p\n">>, [Rep], [{charsLimit, FmtMaxBytes}]), true}; + {<<"ERROR REPORT">>, Pid1, eFmt:formatBin(<<"~p">>, [Rep], [{charsLimit, FmtMaxBytes}]), true}; {error_report, _GL, Other} -> perhapsSaslReport(error_report, Other, FmtMaxBytes); _ -> @@ -177,9 +177,9 @@ writeLog(Event, #state{fileName = FileName, fd = FD, inode = Inode, cTime = CTim handleCast({mWriteLog, Event}, NewState); _ -> TimeBinStr = lgUtil:msToBinStr(), - Time = [TimeBinStr, <<" =">>, ReportStr, <<"====\n">>], + Time = [TimeBinStr, <<" =">>, ReportStr, <<"====\n\t\t">>], NodeSuffix = otherNodeSuffix(Pid), - Msg = eFmt:formatBin(<<"~s~s~s">>, [Time, MsgStr, NodeSuffix]), + Msg = eFmt:formatBin(<<"~s~s~s~n">>, [Time, MsgStr, NodeSuffix]), case file:write(NewFD, unicode:characters_to_binary(Msg)) of {error, Reason} when Flap == false -> ?INT_LOG(?llvError, <<"Failed to write log message to file ~ts: ~s">>, [FileName, file:format_error(Reason)]),