ソースを参照

ft: crashlog修改

master
SisMaker 4年前
コミット
043faaeae4
2個のファイルの変更14行の追加17行の削除
  1. +1
    -1
      src/crashLog/rumCrashLog.erl
  2. +13
    -16
      src/utils/rumUtil.erl

+ 1
- 1
src/crashLog/rumCrashLog.erl ファイルの表示

@ -187,7 +187,7 @@ do_log({log, Event}, #state{fileName = Name, fd = FD, inode = Inode, ctime = Cti
case Rotator:ensure_logfile(Name, FD, Inode, Ctime, false) of case Rotator:ensure_logfile(Name, FD, Inode, Ctime, false) of
{ok, {_FD, _Inode, _Ctime, Size}} when RotSize /= 0, Size > RotSize -> {ok, {_FD, _Inode, _Ctime, Size}} when RotSize /= 0, Size > RotSize ->
_ = Rotator:rotate_logfile(Name, Count), _ = Rotator:rotate_logfile(Name, Count),
handle_cast({log, Event}, State);
handleCast({log, Event}, State);
{ok, {NewFD, NewInode, NewCtime, _Size}} -> {ok, {NewFD, NewInode, NewCtime, _Size}} ->
TimeBinStr = rumUtil:msToBinStr(), TimeBinStr = rumUtil:msToBinStr(),
Time = [TimeBinStr, " =", ReportStr, "====\n"], Time = [TimeBinStr, " =", ReportStr, "====\n"],

+ 13
- 16
src/utils/rumUtil.erl ファイルの表示

@ -479,23 +479,20 @@ is_loggable(Msg, SeverityThreshold, MyName) when is_integer(SeverityThreshold) -
rumMsg:severity_as_int(Msg) =< SeverityThreshold orelse rumMsg:severity_as_int(Msg) =< SeverityThreshold orelse
lists:member(MyName, rumMsg:destinations(Msg)). lists:member(MyName, rumMsg:destinations(Msg)).
%% When logRoot option is provided, get the real path to a file
parsePath(RelPath) -> parsePath(RelPath) ->
RelPath2 = case rumUtil:get_env(logRoot, undefined) of
{ok, LogRoot} when is_list(LogRoot) -> % Join relative path
%% check if the given RelPath contains LogRoot, if so, do not add
%% it again; see gh #304
case filename:dirname(RelPath) of
"." ->
filename:join(LogRoot, RelPath);
false ->
RelPath
end;
undefined -> % No logRoot given, keep relative path
RelPath
end,
%% see #534 make sure c:cd can't change file path, trans filename to abs name
filename:absname(RelPath2).
NewRelPath =
case rumUtil:get_env(logRoot, undefined) of
undefined ->
RelPath;
LogRoot ->
case filename:dirname(RelPath) of
"." ->
filename:join(LogRoot, RelPath);
false ->
RelPath
end
end,
filename:absname(NewRelPath).
%% Find a file among the already installed handlers. %% Find a file among the already installed handlers.
%% %%

読み込み中…
キャンセル
保存