Procházet zdrojové kódy

ft: 格式修正

master
SisMaker před 3 roky
rodič
revize
60cb9672a1
1 změnil soubory, kde provedl 5 přidání a 5 odebrání
  1. +5
    -5
      src/crashLog/lgCrashLog.erl

+ 5
- 5
src/crashLog/lgCrashLog.erl Zobrazit soubor

@ -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)]),

Načítá se…
Zrušit
Uložit