소스 검색

Merge pull request #1920 from ferd/fallback-log

Fallback when logging isn't initialized
pull/1921/head
Fred Hebert 6 년 전
committed by GitHub
부모
커밋
ac69c38986
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
1개의 변경된 파일11개의 추가작업 그리고 4개의 파일을 삭제
  1. +11
    -4
      src/rebar_log.erl

+ 11
- 4
src/rebar_log.erl 파일 보기

@ -93,11 +93,18 @@ get_level() ->
end.
log(Level = error, Str, Args) ->
{ok, LogState} = application:get_env(rebar, log),
ec_cmd_log:Level(LogState, lists:flatten(cf:format("~!^~ts~n", [Str])), Args);
case application:get_env(rebar, log) of
{ok, LogState} ->
NewStr = lists:flatten(cf:format("~!^~ts~n", [Str])),
ec_cmd_log:Level( LogState, NewStr, Args);
undefined -> % fallback
io:format(standard_error, Str++"~n", Args)
end;
log(Level, Str, Args) ->
{ok, LogState} = application:get_env(rebar, log),
ec_cmd_log:Level(LogState, Str++"~n", Args).
case application:get_env(rebar, log) of
{ok, LogState} -> ec_cmd_log:Level(LogState, Str++"~n", Args);
undefined -> io:format(Str++"~n", Args)
end.
crashdump(Str, Args) ->
crashdump("rebar3.crashdump", Str, Args).

불러오는 중...
취소
저장